
Vultr's BGP feature allows you to bring your own IP space and use it across any of our locations. Use this guide to configure BGP for your own IP address space. We also have guides to configure BGP with floating IPs for high availability.
To use BGP, you need:
If you are advertising an IPv4 prefix, the server instance must have an IPv4 address automatically assigned from by Vultr. If you are advertising an IPv6 prefix, the server instance must have both IPv4 and IPv6 addresses automatically assigned by Vultr.
Please complete the BGP setup form to begin. Ensure you verify ownership of your ASN and subnet(s) to prevent delays. You will need at minimum a /24 of IPv4 space, or a /48 of IPv6 space. Smaller subnets are not routable on the internet.
Once we have approved the configuration, you will need to build a BGP session to our endpoint.
For Vultr VPS, use the following settings:
Note: Vultr does not advertise the full internet BGP table to Bare Metal servers.
For Vultr Bare Metal, use the following settings:
Note: You will use the same IPv4/IPv6 address regardless of where you are connecting from. Once we have completed setup, we provide example FRR and BIRD configurations in your Vultr Console. The configurations are found on each subscription page on the BGP tab.
We will announce your prefix(es) to our upstream providers in whatever location you choose to deploy your instance. The carrier mix may be different from location to location and may cause unequal BGP paths. If you plan to use multiple locations (anycast) we cannot guarantee the even distribution of connections to your selected locations.
If your instance was deployed before BGP was setup on your account, you need to reboot it via the control panel. BGP will not work on existing instances until they've been rebooted via the control panel, rebooting via SSH is not sufficient.
We recommend using BIRD as your BGP daemon (but you can use any BGP daemon you want). Most operating systems have a package available for this.
Our example assumes the following:
To confirm connectivity, let's set up a BGP session without announcing any IPs. Create a /etc/bird.conf file with the following text. Note that on some systems, such as Ubuntu 16.04, this will be /etc/bird/bird.conf.
For Vultr VPS, use the following settings:
For Vultr Bare Metal, use the following settings:
Restart bird and check the status of the session:
A BGP state of Established means that everything is working properly. If you don't see a state of Established, here are some things to try:
Once you have a working BGP session, the next step is to start announcing some routes. In order for your address space to be visible on the internet, you would need to announce at least a /24 (or /48 for IPv6).
The easiest way of getting started is to add a static route to your BIRD configuration, such as:
The 'protocol device' block lets BIRD gather information about the network adapters attached to your instance. Without it, your static routes will not appear.
Note: For BIRD 1.5 and above, you may need to change the route lines' syntax.
From:
To:
Reload BIRD, then verify your route is working properly:
At this point, traffic for your subnet should now be flowing towards your instance. You won't be able to ping any IPs until they're configured within your operating system. One way to verify this would be to use tcpdump, 'tcpdump -i eth0 -n net 198.51.100.0/24'.
One common configuration we see is using individual IP addresses on different instances. This is possible, though each instance would need to be running its own BGP server.
To do this, we're going to announce /32 routes from individual instances, in addition to the covering /24. We could do this with static routes, but we recommend using dummy interfaces instead. We'll use 198.51.100.100 as the IP we want to route.
Set this up on an interface:
Confirm this was configured properly:
Note: You should consult your operating system's documentation to determine how to configure this interface to come upon boot.
Now we'll configure BIRD to scan for any dummy interfaces and announce any IPs it finds on them. Add the following to your BIRD configuration, and reload BIRD:
Verify that BIRD is announcing the route:
You can repeat this process on other instances with other IPs. What happens is our routers will use the most specific route they have for any given IP address. When there's a /24 and /32, the /32 is the most specific route, so any traffic for that IP will follow that route.
You can have multiple instances announcing the same /32. This provides high availability. If any instance fails, its routes will disappear and traffic will fail over to the other instance. A common use for this is to be able to use IPs from a larger subnet on multiple instances. In order for this to work, you must be advertising a /24 IPv4 or /48 IPv6 as well. All uses of a smaller announcement must be within the same location.
Our locations are not linked, so you would need to ensure you're announcing a /24 (or IPv6 /48) out of each location where you want to use the IPs. You cannot use one /24 to assign IPs for multiple locations unless you're trying to set up an anycast network.
The default FreeBSD configuration will not work with BGP. In order to actually make use of BGP on FreeBSD, you'll need to do a few things:
Load tcpmd5 kernel module on runtime:
To persist across reboot add the following line to /boot/loader.conf:
Configure your network adapter with a static IP.
Update ipsec.conf with the BGP password:
Install bird with:
Change the configuration accordingly:
Our systems require TCP MD5 authentication in order to establish the connection. This means that you cannot test connectivity using something like telnet. We'd generally suggest watching the traffic with tcpdump in order to troubleshoot connectivity issues.
0 Comments
Be the first to comment and share your perspective with the community.