Skip to main content

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

  1. BNG initiates TCP connection to neighbor IP on port 179
  2. BGP OPEN message exchange
  3. Neighbor relationship established
  4. Route updates begin

Subscriber Route Advertisement

When announce_subscriber_routes is enabled:

  1. Subscriber session established (PPPoE or DHCP)
  2. Subscriber IP assigned (e.g., 203.0.113.10)
  3. Host route created in kernel (/32 for PPPoE, /32 for DHCP)
  4. FRR picks up route via redistribute connected
  5. Route advertised to BGP neighbors
  6. Upstream network can reach subscriber directly

Route Withdrawal

When subscriber disconnects:

  1. Session terminated
  2. Host route removed from kernel
  3. FRR withdraws route from BGP
  4. BGP neighbors receive withdrawal
  5. 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

FieldValidation
bgp.enabledBoolean
bgp.asnInteger 1-4294967295
bgp.neighbors[].addressValid IPv4 address
bgp.neighbors[].remote_asInteger 1-4294967295
bgp.announce_subscriber_routesBoolean
ospf.enabledBoolean

Best Practices

  1. ASN — Use private ASN range (64512-65534 or 4200000000+)
  2. Router ID — Use loopback IP (system.router_id)
  3. Neighbors — Configure redundant neighbors for resilience
  4. Route Advertisement — Enable for subscriber reachability
  5. Monitoring — Monitor BGP session state and route count
  6. Testing — Test with traceroute from upstream
  7. Documentation — Document ASN and neighbor relationships

Troubleshooting

BGP Neighbor Not Establishing

  1. Check BGP is enabled: show configuration | match bgp
  2. Check neighbor is reachable: ping 10.255.0.254
  3. Check firewall allows TCP 179
  4. Check FRR is running: sudo systemctl status frr
  5. Check FRR logs: sudo vtysh -c "show bgp neighbors"

Subscriber Routes Not Advertised

  1. Check route advertisement is enabled: show configuration | match announce_subscriber_routes
  2. Check subscriber route exists: show routes | match 203.0.113
  3. Check FRR is advertising: sudo vtysh -c "show bgp ipv4 unicast"
  4. Check neighbor is receiving: Check upstream router's BGP table

BGP Session Flapping

  1. Check network stability: ping -c 100 10.255.0.254
  2. Check for configuration changes
  3. Check FRR logs: sudo journalctl -u frr -f
  4. Check for resource exhaustion: free -h, df -h

Next Steps