BGP/OSPF Integration
Integrating AthenaBNG with FRRouting for dynamic routing.
Overview
AthenaBNG integrates with FRRouting to advertise subscriber routes to upstream networks via BGP and OSPF.
BGP Integration
Configuration
routing:
bgp:
enabled: true
asn: 64512
router_id: "10.255.0.1"
neighbors:
- address: "10.255.0.254"
remote_as: 64500
description: "Upstream Router"
announce_subscriber_routes: true
How It Works
1. Subscriber session established
└─ Subscriber IP: 203.0.113.10
2. Host route created in kernel
└─ /32 route via subscriber interface
3. FRR picks up route
└─ redistribute connected
4. Route advertised to BGP neighbors
└─ Neighbor 10.255.0.254 receives route
5. Upstream network can reach subscriber
└─ Direct routing without intermediate hops
Neighbor Configuration
routing:
bgp:
neighbors:
- address: "10.255.0.254"
remote_as: 64500
description: "Primary Upstream"
- address: "10.255.0.253"
remote_as: 64500
description: "Secondary Upstream"
Route Advertisement
Enable subscriber route advertisement:
routing:
bgp:
announce_subscriber_routes: true
When enabled:
- Subscriber routes are advertised to all BGP neighbors
- Routes are withdrawn when subscriber disconnects
- Upstream networks can reach subscribers directly
OSPF Integration
Configuration
routing:
ospf:
enabled: true
router_id: "10.255.0.1"
areas:
- id: "0.0.0.0"
networks:
- "10.255.0.0/24"
redistribute:
- connected
How It Works
Similar to BGP, but using OSPF:
1. Subscriber route created in kernel
2. FRR picks up route via redistribute connected
3. Route advertised via OSPF
4. Upstream routers learn route via OSPF
5. Traffic routed directly to subscriber
Monitoring
View BGP Summary
abng> show bgp summary
View BGP Routes
abng> show bgp ipv4 unicast
View Neighbors
sudo vtysh -c "show bgp neighbors"
View Advertised Routes
sudo vtysh -c "show bgp ipv4 unicast neighbors 10.255.0.254 advertised-routes"
View Received Routes
sudo vtysh -c "show bgp ipv4 unicast neighbors 10.255.0.254 received-routes"
Troubleshooting
BGP Neighbor Not Establishing
-
Check neighbor is reachable:
ping 10.255.0.254 -
Check firewall allows TCP 179:
sudo ufw allow 179/tcp -
Check FRR is running:
sudo systemctl status frr -
Check BGP configuration:
sudo vtysh -c "show bgp summary"
Subscriber Routes Not Advertised
-
Check route advertisement is enabled:
abng> show configuration | match announce_subscriber_routes -
Check subscriber route exists:
ip route show | grep 203.0.113 -
Check FRR is advertising:
sudo vtysh -c "show bgp ipv4 unicast" -
Check neighbor is receiving:
# On upstream router
show bgp ipv4 unicast neighbors <bng-ip> received-routes
BGP Session Flapping
-
Check network stability:
ping -c 100 10.255.0.254 -
Check for configuration changes:
abng> show configuration | match bgp -
Check FRR logs:
sudo journalctl -u frr -f -
Check resource usage:
free -h
df -h
Best Practices
- ASN — Use private ASN range (64512-65534)
- Router ID — Use stable IP (loopback or management)
- Redundancy — Configure multiple neighbors
- Route Advertisement — Enable for subscriber reachability
- Monitoring — Monitor BGP session state
- Testing — Test with
traceroutefrom upstream - Documentation — Document ASN and neighbor relationships
Advanced Topics
BGP Communities
Tag routes with communities:
sudo vtysh -c "configure terminal" -c "router bgp 64512" \
-c "address-family ipv4 unicast" \
-c "neighbor 10.255.0.254 send-community"
Route Filtering
Filter routes by prefix:
sudo vtysh -c "configure terminal" -c "router bgp 64512" \
-c "address-family ipv4 unicast" \
-c "neighbor 10.255.0.254 prefix-list out SUBSCRIBERS"
Route Summarization
Summarize subscriber routes:
sudo vtysh -c "configure terminal" -c "router bgp 64512" \
-c "address-family ipv4 unicast" \
-c "aggregate-address 203.0.113.0/24 summary-only"
Next Steps
- Custom Overhead Profiles — Overhead tuning
- VRF Steering — VRF-based traffic steering