Octet

How do you send or receive a default route with BGP?

Show the answer

Say this first

To send one, the cleanest way is neighbor x default-originate, which sends 0.0.0.0/0 to that neighbor only; on Cisco it does not even need a default in the local routing table. The alternatives are network 0.0.0.0, which needs a default in the routing table, or redistributing a default together with default-information originate. To receive one, I ask the ISP for default only or default plus partial routes and permit 0.0.0.0/0 in my inbound prefix list.

Go deeper

Sending

Cisco IOS
router bgp 64496
 neighbor 192.0.2.2 remote-as 64500
 neighbor 192.0.2.2 default-originate

Conditional version: advertise the default only while some upstream route exists in the routing table.

Cisco IOS
ip prefix-list UPSTREAM seq 5 permit 198.51.100.0/24
!
route-map HAVE-UPSTREAM permit 10
 match ip address prefix-list UPSTREAM
!
router bgp 64496
 neighbor 192.0.2.2 default-originate route-map HAVE-UPSTREAM

Receiving

Cisco IOS
ip prefix-list DEFAULT-ONLY seq 5 permit 0.0.0.0/0
!
router bgp 64500
 neighbor 192.0.2.1 prefix-list DEFAULT-ONLY in
Output
R1# show ip route | include 0.0.0.0
Gateway of last resort is 192.0.2.1 to network 0.0.0.0
B*    0.0.0.0/0 [20/0] via 192.0.2.1, 00:12:44

Spreading it inside

Do not redistribute BGP into the IGP. Originate a default into OSPF on the edge router with default-information originate, which by default only works while the router itself has a default.

Traps

  • Writing 0.0.0.0/0 le 32 when you mean default only.
How did you do?Book 4.1 Global Internet