Configure OSPF with FRRouting 10 for dynamic routing protocols and network failover

Advanced 45 min Apr 06, 2026 46 views
Ubuntu 24.04 Debian 12 AlmaLinux 9 Rocky Linux 9

Set up OSPF dynamic routing with FRRouting 10 for automatic network failover and route redistribution. Configure area authentication, routing policies, and monitoring for enterprise network resilience.

Prerequisites

  • Root or sudo access
  • Multiple network interfaces or VMs for testing
  • Basic understanding of IP routing concepts
  • Network connectivity between test nodes

What this solves

OSPF (Open Shortest Path First) provides dynamic routing that automatically adapts to network changes, eliminating manual route configuration and enabling seamless failover when links go down. FRRouting 10 offers enterprise-grade OSPF implementation with advanced features like area authentication, route filtering, and network monitoring that keep your infrastructure resilient and self-healing.

Step-by-step installation

Update system packages

Start by updating your package manager to ensure compatibility with the latest FRRouting packages.

sudo apt update && sudo apt upgrade -y
sudo dnf update -y

Install FRRouting 10

Install FRRouting from the official repository to get the latest OSPF features and security updates.

curl -s https://deb.frrouting.org/frr/keys.asc | sudo apt-key add -
echo 'deb [signed-by=/usr/share/keyrings/frrouting.gpg] https://deb.frrouting.org/frr $(lsb_release -s -c) frr-stable' | sudo tee -a /etc/apt/sources.list.d/frr.list
sudo apt update
sudo apt install -y frr frr-pythontools
sudo dnf install -y https://rpm.frrouting.org/repo/$(rpm -E %rhel)-repo-1-0.el$(rpm -E %rhel).noarch.rpm
sudo dnf install -y frr frr-pythontools

Enable OSPF daemon

Configure FRRouting to enable the OSPF daemon by editing the daemon configuration file.

bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
pimd=no
ldpd=no
nhrpd=no
eigrpd=no
babeld=no
sharpd=no
pbrd=no
bfdd=no
fabricd=no
vrrpd=no
pathd=no
vtysh_enable=yes
zebra_options="-s 90000000"
ospfd_options="-A 127.0.0.1"
vtysh_enable=yes

Configure basic OSPF settings

Create the initial OSPF configuration with router ID, area definitions, and network advertisements.

frr version 10.0
frr defaults traditional
hostname router1
log syslog informational
service integrated-vtysh-config
!
interface eth0
 ip address 203.0.113.10/24
 ip ospf area 0.0.0.0
!
interface eth1
 ip address 192.168.1.1/24
 ip ospf area 0.0.0.1
!
router ospf
 ospf router-id 203.0.113.10
 network 203.0.113.0/24 area 0.0.0.0
 network 192.168.1.0/24 area 0.0.0.1
 area 0.0.0.1 stub
 passive-interface default
 no passive-interface eth0
 no passive-interface eth1
!
line vty
!
end

Set file permissions and ownership

Configure proper permissions for FRRouting configuration files to ensure security while allowing the service to read them.

sudo chown frr:frr /etc/frr/frr.conf
sudo chmod 640 /etc/frr/frr.conf
sudo chown frr:frrvty /etc/frr/vtysh.conf
sudo chmod 640 /etc/frr/vtysh.conf
Never use chmod 777. It gives every user on the system full access to your routing configuration. The frr user needs read access, and the frrvty group needs read access for management tools.

Enable IP forwarding

Enable IP forwarding in the kernel to allow the router to forward packets between networks.

echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding=1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Start and enable FRRouting

Start FRRouting services and enable them to start automatically on boot.

sudo systemctl enable frr
sudo systemctl start frr
sudo systemctl status frr

Configure OSPF authentication and security

Set up area authentication

Configure MD5 authentication for OSPF areas to prevent unauthorized routers from joining your network.

sudo vtysh
configure terminal
router ospf
area 0.0.0.0 authentication message-digest
area 0.0.0.1 authentication message-digest
exit
interface eth0
ip ospf message-digest-key 1 md5 SecureOSPFKey123
exit
interface eth1
ip ospf message-digest-key 1 md5 SecureOSPFKey123
exit
write memory
exit

Configure OSPF timers and priorities

Optimize OSPF convergence times and set interface priorities for designated router election.

sudo vtysh
configure terminal
interface eth0
ip ospf hello-interval 5
ip ospf dead-interval 20
ip ospf priority 100
exit
interface eth1
ip ospf hello-interval 10
ip ospf dead-interval 40
ip ospf priority 50
exit
router ospf
timers throttle spf 200 1000 10000
write memory
exit

Implement routing policies and filtering

Create route filtering with access lists

Set up access lists to control which routes are advertised and accepted by OSPF.

sudo vtysh
configure terminal
access-list 10 permit 192.168.0.0/16
access-list 10 permit 203.0.113.0/24
access-list 10 deny any
!
access-list 20 deny 10.0.0.0/8
access-list 20 permit any
!
router ospf
distribute-list 10 out
distribute-list 20 in
write memory
exit

Configure route summarization

Implement route summarization to reduce routing table size and improve network efficiency.

sudo vtysh
configure terminal
router ospf
area 0.0.0.1 range 192.168.0.0/16
area 0.0.0.0 range 203.0.113.0/24
summary-address 172.16.0.0/12
write memory
exit

Set up route redistribution

Configure OSPF to redistribute routes from other routing protocols or static routes.

sudo vtysh
configure terminal
router ospf
redistribute static metric 100 metric-type 2
redistribute connected metric 50 metric-type 1
default-information originate metric 10 metric-type 1
write memory
exit

Configure network monitoring and logging

Enable OSPF debugging and logging

Configure comprehensive logging to monitor OSPF neighbor relationships and LSA updates.

sudo vtysh
configure terminal
log file /var/log/frr/ospf.log
log record-priority
log timestamp precision 3
service advanced-vty
debug ospf event
debug ospf lsa
debug ospf neighbor
write memory
exit

Configure SNMP for monitoring

Set up SNMP access for network monitoring tools like those covered in our SNMP and Grafana monitoring tutorial.

sudo vtysh
configure terminal
snmp-server community public ro
snmp-server community private rw
snmp-server location "Network Core Router"
snmp-server contact "admin@example.com"
write memory
exit

Set up log rotation

Configure log rotation to prevent OSPF logs from consuming excessive disk space.

/var/log/frr/ospf.log {
    weekly
    rotate 12
    compress
    delaycompress
    missingok
    notifempty
    create 640 frr frr
    postrotate
        systemctl reload frr
    endscript
}

Verify your setup

sudo systemctl status frr
sudo vtysh -c "show ip ospf neighbor"
sudo vtysh -c "show ip ospf database"
sudo vtysh -c "show ip route ospf"
sudo vtysh -c "show ip ospf interface"
ping -c 4 203.0.113.1
ip route show

Check OSPF neighbor states and route learning:

sudo vtysh -c "show ip ospf neighbor detail"
sudo vtysh -c "show ip ospf database router"
sudo vtysh -c "show ip ospf border-routers"
tail -f /var/log/frr/ospf.log

Common issues

SymptomCauseFix
OSPF neighbors not formingAuthentication mismatch or network type conflictCheck show ip ospf interface and verify authentication keys match
Routes not appearing in tableArea configuration mismatch or filtering rulesVerify area IDs match and check distribute-lists with show access-lists
Slow convergence after link failureDefault OSPF timers too conservativeReduce hello-interval and dead-interval, tune SPF throttling
FRR service fails to startConfiguration syntax errorsCheck sudo vtysh -f /etc/frr/frr.conf for syntax validation
LSA flooding consuming bandwidthNetwork instability or misconfigured areasImplement area summarization and check for routing loops
Permission denied errorsIncorrect file ownership or permissionsEnsure chown frr:frr and chmod 640 on config files

Next steps

Automated install script

Run this to automate the entire setup

Need help?

Don't want to manage this yourself?

We handle private cloud infrastructure for businesses that depend on uptime. From initial setup to ongoing operations.