Routing Configuration
Configure BGP and OSPF for subscriber route advertisement.
Overview
The routing section configures dynamic routing protocols:
- BGP — Border Gateway Protocol for upstream peering
- OSPF — Open Shortest Path First for internal routing
- Subscriber route advertisement to upstream networks
- Integration with FRRouting
Configuration Options
bgp
BGP configuration section (optional).
routing:
bgp:
enabled: true
asn: 64512
neighbors:
- address: "10.255.0.254"
remote_as: 64500
announce_subscriber_routes: true
BGP Options
enabled
Enable or disable BGP (optional).
bgp:
enabled: true
Type: Boolean
Required: No
Default: false
Valid values: true, false
CLI:
abng# set routing bgp enabled true
asn
Autonomous System Number (required when enabled).
bgp:
asn: 64512
Type: Integer
Required: Yes (if BGP enabled)
Constraints: Valid ASN (1-4294967295)
Private ASN ranges:
- 64512-65534 (16-bit)
- 4200000000-4294967294 (32-bit)
CLI:
abng# set routing bgp asn 64512
neighbors
BGP neighbor list (required when enabled).
bgp:
neighbors:
- address: "10.255.0.254"
remote_as: 64500
Neighbor Options
address — Neighbor IP address (required).
neighbors:
- address: "10.255.0.254"
Type: IPv4 address
Required: Yes
Constraints: Valid IPv4 address
remote_as — Neighbor ASN (required).
neighbors:
- remote_as: 64500
Type: Integer
Required: Yes
Constraints: Valid ASN (1-4294967295)
announce_subscriber_routes
Advertise subscriber routes to BGP neighbors (optional).
bgp:
announce_subscriber_routes: true
Type: Boolean
Required: No
Default: false
Valid values: true, false
Purpose: If enabled, each subscriber /32 is advertised as a BGP route.
CLI:
abng# set routing bgp announce_subscriber_routes true
ospf
OSPF configuration section (optional).
routing:
ospf:
enabled: false
OSPF Options
enabled
Enable or disable OSPF (optional).
ospf:
enabled: false
Type: Boolean
Required: No
Default: false
Valid values: true, false
CLI:
abng# set routing ospf enabled true
Example Configurations
BGP Only
routing:
bgp:
enabled: true
asn: 64512
neighbors:
- address: "10.255.0.254"
remote_as: 64500
announce_subscriber_routes: true
Multiple BGP Neighbors
routing:
bgp:
enabled: true
asn: 64512
neighbors:
- address: "10.255.0.254"
remote_as: 64500
- address: "10.255.0.253"
remote_as: 64500
announce_subscriber_routes: true
BGP with OSPF
routing:
bgp:
enabled: true
asn: 64512
neighbors:
- address: "10.255.0.254"
remote_as: 64500
announce_subscriber_routes: true
ospf:
enabled: true
Configuration via CLI
Enable BGP
abng> configure
abng# set routing bgp enabled true
abng# set routing bgp asn 64512
abng# commit
Add BGP Neighbor
abng# set routing bgp neighbors[0] address "10.255.0.254"
abng# set routing bgp neighbors[0] remote_as 64500
abng# commit
Enable Subscriber Route Advertisement
abng# set routing bgp announce_subscriber_routes true
abng# commit
Enable OSPF
abng# set routing ospf enabled true
abng# commit
Verification
View Routing Configuration
abng> show configuration | match "^routing:"
routing:
bgp:
enabled: true
asn: 64512
neighbors:
- address: 10.255.0.254
remote_as: 64500
announce_subscriber_routes: true
View BGP Summary
abng> show bgp summary
BGP Router ID: 10.255.0.1
Local AS: 64512
Neighbor Remote AS State Uptime Sent/Rcvd
10.255.0.254 64500 Established 14d 3h 1,247/1,245
View Routes
abng> show routes
┌──────────────────┬──────────┬──────────────┬──────────┬──────────┐
│ Destination │ Gateway │ Interface │ Protocol │ Metric │
├──────────────────┼──────────┼──────────────┼──────────┼──────────┤
│ 203.0.113.10/32 │ — │ ppp0 │ connected│ 0 │
│ 203.0.113.20/32 │ — │ eth1.111.5 │ connected│ 0 │
│ 10.0.0.0/8 │ 10.255.0 │ eth2 │ bgp │ 100 │
│ 0.0.0.0/0 │ 10.255.0 │ eth2 │ bgp │ 100 │
└──────────────────┴──────────┴──────────────┴──────────┴──────────┘
Check FRRouting Status
sudo systemctl status frr
sudo vtysh -c "show bgp summary"
How Routing Works
BGP Neighbor Establishment
- BNG initiates TCP connection to neighbor IP on port 179
- BGP OPEN message exchange
- Neighbor relationship established
- Route updates begin
Subscriber Route Advertisement
When announce_subscriber_routes is enabled:
- Subscriber session established (PPPoE or DHCP)
- Subscriber IP assigned (e.g., 203.0.113.10)
- Host route created in kernel (/32 for PPPoE, /32 for DHCP)
- FRR picks up route via
redistribute connected - Route advertised to BGP neighbors
- Upstream network can reach subscriber directly
Route Withdrawal
When subscriber disconnects:
- Session terminated
- Host route removed from kernel
- FRR withdraws route from BGP
- BGP neighbors receive withdrawal
- Route no longer reachable
Integration with FRRouting
FRRouting is configured to:
- Redistribute kernel routes (subscriber /32s)
- Accept BGP routes from neighbors
- Maintain routing table
FRR config (auto-generated):
router bgp 64512
bgp router-id 10.255.0.1
neighbor 10.255.0.254 remote-as 64500
!
address-family ipv4 unicast
redistribute connected
neighbor 10.255.0.254 activate
exit-address-family
Validation Rules
| Field | Validation |
|---|---|
bgp.enabled | Boolean |
bgp.asn | Integer 1-4294967295 |
bgp.neighbors[].address | Valid IPv4 address |
bgp.neighbors[].remote_as | Integer 1-4294967295 |
bgp.announce_subscriber_routes | Boolean |
ospf.enabled | Boolean |
Best Practices
- ASN — Use private ASN range (64512-65534 or 4200000000+)
- Router ID — Use loopback IP (system.router_id)
- Neighbors — Configure redundant neighbors for resilience
- Route Advertisement — Enable for subscriber reachability
- Monitoring — Monitor BGP session state and route count
- Testing — Test with
traceroutefrom upstream - Documentation — Document ASN and neighbor relationships
Troubleshooting
BGP Neighbor Not Establishing
- Check BGP is enabled:
show configuration | match bgp - Check neighbor is reachable:
ping 10.255.0.254 - Check firewall allows TCP 179
- Check FRR is running:
sudo systemctl status frr - Check FRR logs:
sudo vtysh -c "show bgp neighbors"
Subscriber Routes Not Advertised
- Check route advertisement is enabled:
show configuration | match announce_subscriber_routes - Check subscriber route exists:
show routes | match 203.0.113 - Check FRR is advertising:
sudo vtysh -c "show bgp ipv4 unicast" - Check neighbor is receiving: Check upstream router's BGP table
BGP Session Flapping
- Check network stability:
ping -c 100 10.255.0.254 - Check for configuration changes
- Check FRR logs:
sudo journalctl -u frr -f - Check for resource exhaustion:
free -h,df -h
Next Steps
- REST API Configuration — Management interface
- SNMP Configuration — SNMP monitoring
- Configuration Overview — All configuration sections