Data Center & Hosting 3d ago 4 views 4 min read

How to configure a BGP Route Reflector on Ubuntu 24.04

Set up a BGP Route Reflector to scale your iBGP network without full mesh peering. This guide installs Quagga on Ubuntu 24.04 and configures router ID, neighbor groups, and cluster IDs.

Roy S
Updated 1d ago
Sponsored

Cloud Hosting — blazing fast websites

Fully managed cloud hosting with free SSL, auto-backups and a friendly cPanel. Built for WordPress, Laravel and custom PHP apps.

You will configure a BGP Route Reflector to eliminate the need for a full mesh of iBGP sessions in a large network. The steps below install Quagga on Ubuntu 24.04, define the router ID, and set up the route reflector rules for client and non-client peers.

Prerequisites

  • Ubuntu 24.04 LTS server with root access or sudo privileges.
  • At least two network interface cards (NICs) configured with static IP addresses.
  • Static routes configured for the loopback interface and the physical interfaces.
  • Quagga package installed (version 0.99.24-ubuntu1 or newer).
  • Access to the command line interface via SSH or console.

Step 1: Install Quagga and dependencies

Update the package lists and install the Quagga suite. This includes the daemons and the configuration utility needed to manage BGP sessions.

apt update
apt install quagga quagga-frr quagga-utils -y

You will see output indicating the packages are being downloaded and installed. Ensure the installation completes without errors.

Setting up quagga (0.99.24-ubuntu1) ...
Setting up quagga-frr (0.99.24-ubuntu1) ...

Step 2: Configure the router ID

Define a unique Router ID for the BGP process. This is critical for BGP to identify the local router within the AS.

Edit the main Quagga configuration file located at /etc/quagga/quagga.conf. Add the following line to set the router ID to a specific IP address from your loopback interface.

echo "router-id 192.168.1.1" >> /etc/quagga/quagga.conf

Ensure the line is present in the file without any syntax errors. The router ID must be unique within your AS.

Step 3: Configure the BGP process

Start the BGP process and define the Autonomous System (AS) number. Edit the /etc/quagga/daemons file to ensure the BGP daemon is enabled.

vi /etc/quagga/daemons

Set the value for bgpd to YES. Save the file and exit the editor. Then start the Quagga service to load the configuration.

systemctl start quagga
systemctl enable quagga

Verify the service is running with systemctl status quagga. You should see "active (running)" in the status output.

Step 4: Configure the Route Reflector

Edit the BGP configuration file at /etc/quagga/bgpd.conf. Define the AS number and the route reflector settings. Use the router bgp command to enter the BGP configuration mode.

vi /etc/quagga/bgpd.conf

Add the following configuration block. Replace 100 with your AS number, 192.168.1.1 with your router ID, and 64512 with your client peer IP.

router bgp 100
 bgp router-id 192.168.1.1
 bgp log-neighbor-changes

 ! Define the Route Reflector Cluster
 cluster 64512:100

 ! Define the Route Reflector Client (iBGP peer)
 neighbor 64512 remote-as 100
 neighbor 64512 route-reflector-client
 neighbor 64512 description iBGP-Client

 ! Define a Non-Client (eBGP peer or external)
 neighbor 203.0.113.5 remote-as 65000
 neighbor 203.0.113.5 description eBGP-External-ISP

Save the file and exit. The route-reflector-client keyword tells the router to accept routes from this peer and reflect them to other clients in the same cluster.

Step 5: Configure Network Statements

Define the networks that should be advertised into BGP. Add the network statement for each loopback or physical interface IP that needs to be announced.

router bgp 100
 network 192.168.1.0 mask 255.255.255.0
 network 10.0.0.0 mask 255.255.255.0

Ensure the IP addresses in the network command match exactly with your configured interfaces or loopback addresses.

Step 6: Apply the configuration

Reload the BGP configuration to apply the changes without restarting the service. Use the write memory command to save the configuration to the startup file.

screen /etc/quagga/bgpd.conf

Once inside the configuration mode, run:

write memory

Exit the screen session with exit. The configuration is now active.

Verify the installation

Check the BGP neighbor table to confirm the iBGP client session is established. The state should be "Established" for the client peer.

netstat -anp | grep quagga

Alternatively, use the bgpd command to list neighbors:

bgpd -c /etc/quagga/bgpd.conf -s

You should see output similar to:

Neighbor    V   AS   MsgRcvd   MsgSent   TblVer  InQ   OutQ   Up/Down   State
64512.0.0.1  4  100   1234      1234      123     0     0   01:23:45  Established

Verify that routes are being reflected correctly by checking the BGP routing table:

netstat -anp | grep quagga

Ensure the expected routes are present in the BGP table with the correct next-hop and AS path.

Troubleshooting

If the BGP session fails to establish, check the TCP connection between the router and the peer. Ensure the IP addresses and ports (default 179) are correct and not blocked by a firewall.

telnet 64512 179

If the connection is refused, verify the firewall rules on both the local and remote systems. Use iptables or ufw to allow traffic on port 179.

ufw allow 179/tcp

Check the BGP logs for error messages related to AS mismatch or authentication failures. Review the /var/log/syslog or /var/log/quagga files for specific error details.

grep "BGP" /var/log/syslog

Ensure the router ID is unique across the entire iBGP domain. Duplicate router IDs will cause sessions to flap or fail to establish. Verify the router ID is set correctly in the bgpd.conf file.

Confirm that the route-reflector-client keyword is applied only to iBGP peers within the same cluster. Applying it to an eBGP peer will cause the session to fail.

Check the AS numbers configured for each neighbor. The remote AS must match the AS configured on the peer router. Mismatched AS numbers will prevent the session from coming up.

Sponsored

Linux Dedicated Server

Rock-solid Linux dedicated servers with root access, KVM-IPMI and fully managed options. CentOS, Ubuntu, Debian, Rocky and AlmaLinux.

Tags: LinuxUbuntuNetworkingBGPRouting
0
Was this helpful?

Related tutorials

Comments 0

Login to leave a comment.

No comments yet — be the first to share your thoughts.