By combining Border Gateway Protocol (BGP) and Rcs's Reserved IP feature, you can create a Floating IP that provides high availability for your application by automatically redirecting traffic among available instances. This guide explains how to configure a Floating IP using BIRD, a popular routing daemon.
- Learn more about Rcs Reserved IPs.
- For an introduction to BGP, including how to bring your own IP space to Rcs, see Configuring BGP on Rcs.
Example Values
This guide uses example values. Please replace them with your information.
- Instance IPv4 address: 192.0.2.111
- Reserved IPv4 (the Floating IP): 192.0.2.2
- Example BGP AS number: 65500
Look for your instance IP address and BGP AS number on the Customer Portal server information page, and the reserved IP on the Network Reserved IP page.
Rcs's Side of the BGP Session
All Rcs VPS cloud server instances use these BGP values:
- The neighbor IPv4 address is: 169.254.169.254
- Rcs's AS number is: 64515
If you use Rcs Bare Metal, please use these values:
- The neighbor IPv4 address is: 169.254.1.1
- Rcs's AS number is: 20473
Using the Floating IP in Production
You can ensure high availability for your site by using multiple VPS instances with the same BGP configuration. When an instance is unavailable, BGP anycast dynamically makes a one-of-many selection and redirects traffic to an available instance. This routing strategy allows a high number of instances with the same configuration to share a single reserved IP as a floating address. BGP anycast routes traffic from the reserved address to a single instance at any given time. The reserved address, and all available instances, must be in the same location.
BGP anycast distributes traffic with an Equal-Cost Multi-Path (ECMP) routing strategy. ECMP routing means that traffic will be randomly distributed between any instances in the same location announcing an IP address.
Prerequisites
To follow the steps in this guide:
- Deploy multiple Rcs cloud server instances in the same location. This guide uses Ubuntu 20.10 as the example OS. You may need to adapt some instructions for your operating system.
- Add a Reserved IP address to use as the floating IP. Learn more about Reserved IPs. Leave your Reserved IP unattached. This method for floating IPs requires the Reserved IP address remain unattached from all instances. The reserved IP and instances must be in the same location.
- Open a ticket requesting BGP activation for your account. Please request a private ASN assignment unless you have a public ASN. You must restart your instances through the customer portal after Rcs activates BGP in your account.
The steps below explain how to set up a single instance. To achieve high availability, repeat these steps on two or more instances, using the corresponding IP address for each instance.
1. Configure a Dummy Network
SSH to the instance as root.
Create a dummy network interface.
# ip link add dev dummy1 type dummy
Bring the interface up.
# ip link set dummy1 up
Bind the dummy interface to the Reserved IP address. Replace the example
192.0.2.2
with your reserved IP.# ip addr add dev dummy1 192.0.2.2/32
Confirm the network configuration.
# ip addr show dev dummy1 3: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether 00:00:5e:00:53:11 brd ff:ff:ff:ff:ff:ff inet 192.0.2.2/32 scope global dummy1
2. Configure BIRD
Verify your firewall permits traffic on TCP port 179.
In a web browser, navigate to the Rcs customer portal and locate the server information page for your instance.
Click the BGP tab.
Look for the link at the bottom of the page:
Click the BGP configuration link. Refer to this example configuration for the next few steps.
Install BIRD. This guide uses BIRD version 1.6.8.
# apt install bird
Edit your BIRD configuration. On Ubuntu, the BIRD configuration file is
/etc/bird/bird.conf
.# nano /etc/bird/bird.conf
On a new installation, the configuration file looks like this:
router id 192.0.2.111; protocol kernel { scan time 60; import none; } protocol device { scan time 60; }
Edit the
router id
line to match the IP address in your instance BGP example.Add this section to the bottom of the file.
protocol direct { interface "dummy1"; }
Add the
protocol bgp vultr
block from your instance BGP example to the bottom of the file. When finished, your file should look like this. Substitute your values forrouter id
,local as
,source address
, andpassword
.router id 192.0.2.111; protocol kernel { scan time 60; import none; } protocol device { scan time 60; } protocol direct { interface "dummy1"; } protocol bgp vultr { local as 65500; source address 192.0.2.111; import none; export all; graceful restart on; multihop 2; neighbor 169.254.169.254 as 64515; password "YOUR_PASSWORD"; }
Was this answer helpful?