
Setting up high availability ensures that your application remains accessible, even if one of your instances becomes unavailable. On Vultr, you can set up high availability by combining Reserved IPs with Border Gateway Protocol (BGP) routing. This setup enables automatic traffic failover between multiple compute instances within the same region.
This guide explains how to configure Reserved IPs with BGP using BIRD 2.0, a high-performance BGP routing daemon with enhanced security and performance features.
Setting up high availability with Reserved IPs is only supported when the servers are located within the same region. It does not function across multiple regions.
Before you begin, ensure you:
Have access to BGP on your Vultr account. If BGP is not enabled, request access through the Vultr Console.
Have access to Reserved IPv4 and IPv6 addresses to use with BGP.
Have access to two Ubuntu 24.04 instances deployed in the same region.
This guide uses two compute instances for demonstration, but you can configure additional instances based on your infrastructure needs.
This guide uses the following example values. Replace these with your actual IP addresses as needed:
192.0.2.22001:db8:1234:5678::1192.0.2.32001:db8:1234:5678::2192.0.2.4/322001:db8:1234:5678::3/64Use the following BGP configuration values to configure your setup, depending on whether you're using Cloud Compute instance or Bare Metal instance.
In this section, you have to configure Reserved IPs by creating a virtual network interface, installing and configuring BIRD 2.0 for BGP routing, and verifying connectivity with Vultr's BGP service. This setup allows your Reserved IP to move between instances, enabling high availability and automatic failover within the same region.
Create a new virtual network interface on each instance and assign your Reserved IPv4 and IPv6 addresses to it. This allows the server to handle traffic for the Reserved IP, even if it’s not the primary network interface.
Create a new virtual network interface.
Bring up the ha-ip interface.
Assign your Reserved IP addresses to the interface.
Replace 192.0.2.4 and 2001:db8:1234:5678::3/64 with your actual Reserved IPv4 and IPv6 addresses.
Verify the interface configuration.
Your output should be similar to the one below:
Follow these steps to install and configure BIRD 2.0, a BGP routing daemon that advertises your Reserved IP addresses using BGP.
Allow incoming BGP traffic on TCP port 179.
Confirm that the firewall is active and port 179 is allowed through.
Update the server package index.
Install the BIRD 2.0 package.
View the installed BIRD version.
This above command displays the installed version of BIRD.
Back up the default BIRD configuration.
Edit the BIRD configuration file.
Replace the file contents with the following configuration.
In the above configuration:
ha-ip interface.169.254.169.254) and ASN (64515).2001:19f0:ffff::1) and ASN (64515).Restart BIRD 2.0 service to apply the configuration changes.
After configuring BIRD, verify that your BGP sessions are successfully established with Vultr's neighbor peers. A successful connection indicates that your Reserved IPs are now being advertised to Vultr's routing system.
Check the BGP session status for IPv4 and IPv6.
Your output should be similar to the one below:
If both sessions show State: up and BGP state: Established, BIRD is successfully connected to Vultr's BGP peers.
Verify that BIRD is advertising the Reserved IP routes.
Your output should be similar to the one below:
This confirms that your Reserved IPv4 and IPv6 addresses are bound to the ha-ip interface and advertised to the network.
Use the steps below to test if your Reserved IP fails over correctly and responds to traffic as expected.
Open a new terminal on your local machine and ping the Reserved IPs.
Your output should be similar to the one below:
This confirms the Reserved IPs are reachable from outside your instance.
On the primary instance, bring down the virtual interface (ha-ip).
The ping command in your second terminal should stop receiving replies, simulating a failure.
Bring the ha-ip interface back up.
The ping should resume, confirming that traffic correctly routes through the instance when the interface is up.
Repeat all the above steps on each instance you plan to include in the high availability configuration to validate failover behavior across all nodes.
When using BGP for high availability, you can control which server receives traffic by adjusting AS path lengths. BGP routers prefer routes with the shortest AS path. By prepending your local ASN, you artificially lengthen the path and deprioritize a specific instance.
In this example, you:
Configure Server One as the primary instance, which receives traffic by default.
Configure Server Two as the secondary instance, which receives traffic only when Server One is unavailable.
Follow the steps below to use AS path prepending on the secondary server to reduce its routing preference.
Update the BIRD 2.0 configuration on your secondary server.
Add a BGP prepend filter to the export block in both the IPv4 and IPv6 protocol definitions.
Replace <BGP-Private-Instance-ASN> with your actual BGP AS number assigned by Vultr.
Your updated BGP configuration for the second server should look like below.
IPv4
IPv6
This configuration ensures that the secondary instance advertises a longer AS path, making it less preferred for incoming traffic. If the primary instance goes offline, BGP automatically fails over to the secondary route.
You can prepend the local ASN multiple times to further reduce a server’s priority.
ha-ip Virtual Interface ConfigurationManually created virtual interfaces and IP assignments are lost after a reboot. To persist the ha-ip interface and Reserved IPs, configure them with systemd-networkd for a reliable, service-managed high-availability setup.
Create the virtual interface definition.
Add the following network configuration.
Create the network configuration file for Reserved IP assignment.
Add the following configuration.
Replace the IP addresses with your actual Reserved IPv4 and IPv6 addresses.
Enable and start the systemd-networkd service.
View the status of the systemd-networkd service.
The status of the service must be active and running.
Ensure the dummy kernel module loads at boot.
This ensures the dummy module is available and preconfigured after every reboot.
In this guide, you configured a high availability environment on Vultr using Reserved IPs and BGP routing. You created a virtual interface for the Reserved IPs, advertised the routes using BGP, adjusted traffic priority with AS path prepending, and ensured the configuration persists across system reboots. This setup allows seamless traffic failover between multiple instances in the same region, ensuring continuous service availability in case of node failure.
0 Comments
Be the first to comment and share your perspective with the community.