In this post, we will be integrating an OCI hosted VyOS instance with the OCI native VPNaaS (VPN as a service) to create an IPSec Backplane. Once configured, OCI and VyOS will be able to exchange routing information and we can use the VyOS instance to connect remote networks into OCI with the various protocols mentioned in the first blog post in this series.
Here is a high level diagram of what we will be building. Let's get started!
In this configuration, we will build 2 IPSec Tunnels between VyOS and OCI, and then set up BGP to dynamically learn routes over the tunnel. Here are the steps we will follow for deployment.
1.) Prepare the Oracle Cloud environment for the VyOS image
2.) Deploy VyOS on Oracle Cloud Infrastructure
3.) Set up the IPSec Backplane on Oracle Cloud
4.) Set up the IPSec Backplane on VyOS
5.) Deploy a spoke VCN to verify routes are being received by VyOS
1.) Prepare the Oracle Cloud environment for the VyOS image
We will prepare the environment by building some constructs with OCI
2.) Deploy VyOS on Oracle Cloud Infrastructure
Type "VyOS" in the search bar of the OCI console. You will see VyOS as a marketplace image. Make sure that you have the right compartment selected before launching the image.
Now you will configure the image for deployment into the HUB VCN that was just configured. I used these options, but you may need to modify them for your deployment.
After the initial deployment of VyOS is complete, go to the vNIC and configure the following.
3.) Set up the IPSec Backplane on Oracle Cloud
Go to Networking -> Customer Connectivity. We will be adding adding several configurations here.
Be aware that by adding more tunnels and enabling ECMP on the DRG, you can increase the throughput significantly for diverse traffic types. I show a 2 tunnel configuration in this blog, but the configuration in this blog can be used in increase throughput on the backplane.
4.) Set up the IPSec Backplane on VyOS
We are getting close! Now we will configure VyOS to connect into OCI. You can grab the RAW file from my GitHub. This has a pre-built configuration using OCI's recommended parameters for Site-to-Site tunnels. Copy/paste the contents of the GitHub file to your favorite desktop text editor.
Find and replace the following variables with the configuration parameters you built out in previous steps of this post.
Go over the configuration and make sure there are no syntax errors (spaces in IP address, password is correct, etc). Afterwards, SSH into the VyOS router with the username vyos
, and run 'conf'. Copy and paste the script into the router. The router will show errors if there are any syntax errors. If there are no errors, run 'commit;save;exit'. The router will do a final validation of the configuration, and then will save and commit the configuration.
If all is well, you should be able to run "show ip bgp neighbor 1.1.0.1" and the neighbor state should be "Established". Verify this for the 2.1.0.1 neighbor as well. If it didn't work, make sure that you didn't mix up the tunnel_1 and tunnel_2 configuration!
5.) Deploy a spoke VCN to verify routes are being received by VyOS and use for future testing.
Create a new VCN "SPOKE VCN" (10.1.0.0/16) and add the following configurations
Final Verification
If all is working, you should be able to run "show ip route bgp" and see the 10.1.0.0/24 prefix from both BGP neighbors. Great job! Now lets move on to the the VPN configuration that needs to be added to connect remote office and users into the VyOS router, as referred to in the Connecting to Oracle Cloud using VPNs blog series.
Next Post