This guide shows how to route traffic from a Bare Metal Cloud (BMC) backend network to AWS Direct Connect. A router server running FRRouting (FRR) exchanges routes with AWS through Border Gateway Protocol (BGP). Your setup may differ, so adapt the values to your environment.
Prerequisites
Have a working AWS Direct Connect connection with a virtual interface (VIF). Choose a BMC server from your BMC inventory to act as the router server. Use a RedHat-based operating system, or adapt the commands to your distribution. Gather the AWS peer IP address, AWS-side ASN, BGP authentication key, and your backend network address.
Step 1: Enable IP Forwarding
Enable IPv4 and IPv6 forwarding on the router server.
1. Create the /etc/sysctl.d/90-routing-sysctl.conf file with the following:
# Sysctl for routing
#
# Routing: We need to forward packets
net.ipv4.conf.all.forwarding=1
net.ipv6.conf.all.forwarding=1
net.ipv4.conf.enp1s0f0.send_redirects=0
Code language: Properties (properties)
2. Load the new file:
sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.confCode language: Bash (bash)
Step 2: Install pip
1. Download get-pip.py securely:
#curl https://bootstrap.pypa.io/get-pip.py -o get-pip.pyCode language: Bash (bash)
2. Run the installer:
sudo python get-pip.pyCode language: Bash (bash)
Step 3: Set Up FRR
1. Install the required packages:
sudo yum install git autoconf automake libtool make gawk \
readline-devel texinfo net-snmp-devel groff pkgconfig \
json-c-devel pam-devel bison flex pytest c-ares-devel \
perl-XML-LibXML python-devel systemd-develCode language: Bash (bash)
2. Install sphinx:
sudo pip install sphinxCode language: Bash (bash)
3. Create the frr group:
sudo groupadd -g 92 frrCode language: Bash (bash)
4. Create the frrvt group:
sudo groupadd -r -g 85 frrvtCode language: Bash (bash)
5. Create the frr user:
sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \
-c "FRR FRRouting suite" -d /var/run/frr frrCode language: Bash (bash)
6. Clone the FRR repository:
git clone https://github.com/frrouting/frr.git frrCode language: Bash (bash)
7. Change to the repository directory:
cd frrCode language: Bash (bash)
8. Run the bootstrap script:
./bootstrap.shCode language: Bash (bash)
9. Configure the build:
./configure \
--bindir=/usr/bin \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--libdir=/usr/lib/frr \
--libexecdir=/usr/lib/frr \
--localstatedir=/var/run/frr \
--with-moduledir=/usr/lib/frr/modules \
--enable-pimd \
--enable-snmp=agentx \
--enable-multipath=64 \
--enable-ospfclient=yes \
--enable-ospfapi=yes \
--enable-user=frr \
--enable-group=frr \
--enable-vty-group=frrvt \
--enable-rtadv \
--enable-systemd \
--disable-exampledir \
--enable-watchfrr \
--disable-ldpd \
--enable-fpm \
--enable-nhrpd \
--enable-eigrpd \
--enable-babeld \
--with-pkg-git-version \
--with-pkg-extra-version=-MyOwnFRRVersion Code language: Bash (bash)
10. Compile the source:
makeCode language: Bash (bash)
11. Run the tests:
make checkCode language: Bash (bash)
12. Install FRR:
make installCode language: Bash (bash)
Step 4: Create FRR Configuration Files
1. Create directories:
sudo mkdir /var/log/frrCode language: Bash (bash)
sudo mkdir /etc/frrCode language: Bash (bash)
2. Create all the configuration files:
sudo touch /etc/frr/zebra.conf
sudo touch /etc/frr/bgpd.conf
sudo touch /etc/frr/ospfd.conf
sudo touch /etc/frr/ospf6d.conf
sudo touch /etc/frr/isisd.conf
sudo touch /etc/frr/ripd.conf
sudo touch /etc/frr/ripngd.conf
sudo touch /etc/frr/pimd.conf
sudo touch /etc/frr/nhrpd.conf
sudo touch /etc/frr/eigrpd.conf
sudo touch /etc/frr/babeld.conf
sudo touch /etc/frr/vtysh.conf Code language: Bash (bash)
3. Set the ownership:
sudo chown -R frr:frr /etc/frr/ Code language: Bash (bash)
sudo chown frr:frrvt /etc/frr/vtysh.confCode language: Bash (bash)
4. Set the file permissions:
sudo chmod 640 /etc/frr/*.confCode language: Bash (bash)
Step 5: Configure the Daemon
1. Install the daemon configuration file:
sudo install -p -m 644 redhat/daemons /etc/frr/Code language: Bash (bash)
2. Set the file ownership:
sudo chown frr:frr /etc/frr/daemonsCode language: Bash (bash)
3. Open /etc/frr/daemons, and change no to yes for watchfrr_enable, zebra, and bgpd.
Step 6: Install the FRR Service
1. Install the service file:
sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.serviceCode language: Bash (bash)
2. Install the init script:
sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frrCode language: Bash (bash)
3. Register the system files:
sudo systemctl preset frr.serviceCode language: Bash (bash)
Step 7: Configure vtysh and Zebra
1. Open /etc/frr/vtysh.conf and add the following line:
no service integrated-vtysh-config
Code language: plaintext (plaintext)
2. Edit /etc/frr/zebra.conf to match the following:
hostname Zebra
password [user_password]
enable password [enable_password]
log file zebra.log
!
!
!
vrf Default-IP-Routing-Table
ip route 0.0.0.0/0 [aws_peer_ip]
ip route [backend_bmc_network] enp1s0f0
interface enp1s0f0
ip address [your_peer_ip]/30
!
!
!
!
line vty
!
Code language: plaintext (plaintext)
Replace the placeholders:
[user_password]. The password for Zebra.[enable_password]. The enable password for Zebra.[aws_peer_id]. The AWS-side peer IP address of the VIF.[backend_bmc_network]. The backend network of your BMC servers.[your_peer_ip]. The peer IP address of your router server.
Step 8: Configure BGP
Edit /etc/frr/bgpd.conf to match the following:
hostname Bgpd
password [user_password]
enable password [enable_password]
log file bgpd.log
!
!
router bgp [user_assigned_asn_aws_side]
neighbor [aws_peer_ip] remote-as [aws_side_asn]
neighbor [aws_peer_ip] password [aws_bgp_auth_key]
neighbor [aws_peer_ip] timers 10 30
neighbor [aws_peer_ip] default-originate
neighbor [aws_peer_ip] soft-reconfiguration inbound
!
address-family ipv4 unicast
network [backend_bmc_network]
exit-address-family
!
!
line vty
!
Code language: plaintext (plaintext)
Replace the placeholders:
[user_password]. The password for the BGP daemon.[enable_password]. The enable password for the BGP daemon.[aws_peer_ip]. The AWS-side peer IP address of the VIF.[aws_side_asn]. The ASN of the AWS side.[aws_bgp_auth_key]. The BGP authentication key of the virtual interface.[backend_bmc_network]. The backend network of your BMC servers.
Step 9: Start FRR
Start the service:
sudo systemctl start frrCode language: Bash (bash)
The command manually reboots and applies the new settings.
Step 10: Install Telnet
Telnet lets you manage Zebra and the BGP daemon through the virtual terminal (VTY). Install it with:
sudo yum install telnetCode language: Bash (bash)
Step 11: Route Backend Servers Through the Router Server
Configure each server that needs to reach AWS to use the router server as its next hop.
1. On each server, open the configuration file for the backend interface in /etc/sysconfig/network-scripts.
2. Set the gateway rule:
GATEWAY="[router_server_ip]"Code language: Properties (properties)
Replace [router_server_ip] with the router server's IP address.
3. Restart the networking service.