Skip to main content

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

  1. Check neighbor is reachable:

    ping 10.255.0.254
  2. Check firewall allows TCP 179:

    sudo ufw allow 179/tcp
  3. Check FRR is running:

    sudo systemctl status frr
  4. Check BGP configuration:

    sudo vtysh -c "show bgp summary"

Subscriber Routes Not Advertised

  1. Check route advertisement is enabled:

    abng> show configuration | match announce_subscriber_routes
  2. Check subscriber route exists:

    ip route show | grep 203.0.113
  3. Check FRR is advertising:

    sudo vtysh -c "show bgp ipv4 unicast"
  4. Check neighbor is receiving:

    # On upstream router
    show bgp ipv4 unicast neighbors <bng-ip> received-routes

BGP Session Flapping

  1. Check network stability:

    ping -c 100 10.255.0.254
  2. Check for configuration changes:

    abng> show configuration | match bgp
  3. Check FRR logs:

    sudo journalctl -u frr -f
  4. Check resource usage:

    free -h
    df -h

Best Practices

  1. ASN — Use private ASN range (64512-65534)
  2. Router ID — Use stable IP (loopback or management)
  3. Redundancy — Configure multiple neighbors
  4. Route Advertisement — Enable for subscriber reachability
  5. Monitoring — Monitor BGP session state
  6. Testing — Test with traceroute from upstream
  7. 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