Step-by-Step Guide to Install and Configure FRRouting for BGP on Ubuntu or Debian

This guide will walk you through the complete, command-by-command process of installing and configuring FRR for BGP on a dedicated server running Ubuntu or Debian.

Dedicated Servers vs Peer To Peer - CTCservers

Running BGP lets your dedicated server act as a router to announce your IP prefixes globally.

Ubuntu or Debian

The Traffic Directors of the Internet: Understanding FRRouting and BGP

Imagine you want a regular computer to act like a powerful traffic cop for internet data. This is where FRRouting, or FRR for short, comes in. FRR is a free, open-source software program that you can install on standard Linux systems to turn them into smart, fully functional routers. Instead of buying expensive, specialized hardware from big tech companies, network engineers can use FRR on everyday computer servers to guide data safely and efficiently. It acts as the brain of the network, holding the map of connections and supporting many different sets of rules called protocols to keep digital traffic moving smoothly.

One of the most important protocols that FRR supports is called BGP, which stands for Border Gateway Protocol. You can think of BGP as the global postal service or the GPS system of the entire internet. When you send an email or load a webpage, your data has to travel through many different, independent networks to reach its destination. BGP is the universal language that routers use to talk to each other and share these directions. It constantly looks at all the possible paths your data could take across the globe and calculates the best, most reliable route to get your information exactly where it needs to go.

When you combine the flexibility of FRRouting with the global reach of BGP, you get a highly powerful tool for managing internet traffic. Companies, internet service providers, and large data centers use this combination to connect their private networks to the rest of the world. Because FRR is free software and BGP is the standard language of the internet, this pairing allows organizations to build strong, custom-made network systems without spending a fortune. Together, they work behind the scenes every second of the day, ensuring that our digital world stays connected and our information flows without interruption.

Prerequisites

  • Operating System: A modern Linux distribution. Ubuntu (20.04, 22.04, or 24.04) or Debian (11 or 12) are highly recommended because FRR is available in their default package managers. It also works on RHEL/AlmaLinux/Rocky Linux.
  • Hardware: A dedicated server or virtual machine. BGP routing is not very resource-intensive for basic setups; 1 CPU core and 1GB of RAM are generally enough to get started.
  • Permissions: Full root or sudo access to the server. You need this to install software, edit system files, and change kernel parameters.
  • Network Connection: A stable internet connection with a static IP address assigned to your server.
  • Basic Tools: Default system utilities like a package manager (apt for Ubuntu/Debian), a text editor (like nano or vim), and basic networking tools installed.
1

Prepare the System

First, ensure your server is up to date and that IP forwarding is enabled at the kernel level. Without IP forwarding, your server won't route traffic.
1. Update your package lists and upgrade the system:
BASH
sudo apt update && sudo apt upgrade -y
2. Enable IPv4 forwarding:
BASH
echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf
3. (Optional) Enable IPv6 forwarding if you are announcing IPv6:
BASH
echo "net.ipv6.conf.all.forwarding = 1" | sudo tee -a /etc/sysctl.conf
4. Apply the sysctl changes immediately:
BASH
sudo sysctl -p
2

Install FRRouting (FRR)

FRR is available in the default Ubuntu/Debian repositories.
1. Install the FRR package:
BASH
sudo apt install frr frr-pythontools -y
3

Enable the BGP Daemon

By default, FRR installs with all routing daemons disabled. You need to explicitly tell it to run the BGP daemon.
1. Edit the daemons file to enable BGP:
BASH
sudo sed -i 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
2. Restart the FRR service to apply the change:
BASH
sudo systemctl restart frr
3. Enable FRR to start on boot:
BASH
sudo systemctl enable frr
4

Configure BGP via VTYSH

FRR uses an integrated shell called vtysh to configure routing. This will feel very familiar if you have used Cisco or Juniper equipment.
1. Enter the FRR shell:
BASH
sudo vtysh
2. Enter configuration mode:
Plaintext
configure terminal
3. Start the BGP process with your Autonomous System Number (ASN):
(Replace 65000 with your actual ASN)
Plaintext
router bgp 65000
4. Set your BGP Router ID (usually your server's primary public IP):
(Replace 192.0.2.1 with your server's IP)
Plaintext
bgp router-id 192.0.2.1
5. Configure your BGP Neighbor (your upstream provider or peer):
(Replace 198.51.100.1 with their IP, and 64512 with their ASN)
Plaintext
neighbor 198.51.100.1 remote-as 64512
6. (Optional) Add a BGP password if your provider requires MD5 authentication:
(Replace YourSecretPassword with the provided key)
Plaintext
neighbor 198.51.100.1 password YourSecretPassword
7. Enter the IPv4 address family to announce your IP blocks:
Plaintext
address-family ipv4 unicast
8. Announce your specific IP prefix:
(Replace 203.0.113.0/24 with the subnet you own and are authorized to announce)
Plaintext
network 203.0.113.0/24
9. Exit configuration modes and save:
Plaintext
exit-address-family
exit
exit
write memory
5

Verify the BGP Session

Once configured, you need to check if your BGP session has successfully connected to your provider. Stay inside the vtysh shell or enter it again using sudo vtysh.
1. Check the BGP summary:
Plaintext
show ip bgp summary
Look at the State/PfxRcd column. If it says Active or Idle, the connection is down or failing. If it shows a number (like 0 , 1 , or 800000), the session is established.
2. Check the routes you are advertising to your neighbor:
Plaintext
show ip bgp neighbor 198.51.100.1 advertised-routes
3. Exit the FRR shell to return to Linux:
Plaintext
exit

Important Note on Dummy Interfaces (Blackhole Routing)

If your server does not actually have the IPs you are announcing assigned to a physical interface, BGP will not announce them. To fix this, you must route the subnet to a "blackhole" or attach it to a dummy interface on the Linux side so the kernel knows the route exists:
BASH
sudo ip route add 203.0.113.0/24 dev lo

Discover CTCservers Dedicated Server Locations

CTCservers servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.

Limited Time
Special Offers
Server upgrades & more.
UK Region London
15%
OFF
Asia Pacific Tokyo
10%
OFF