In Cisco NX-OS, we can inject the default route into BGP using one of the following:
- The network 0.0.0.0/0 command.
- The redistribute with default-information originate commands.
- The neighbor’s default-originate command.
Default Route Using The Network Command
When injecting a default route into the BGP table using the network 0.0.0.0/0
command, a default route (0.0.0.0/0) should exist in the local routing table (RIB).
The default route can be learned through any means, but if it’s removed from the routing table, BGP withdraws it from the BGP table (RIB). We can populate the routing table with a static default route pointing to null 0.
Default Route Using The Redistribute Command
Injecting a default route through the redistribute command requires the default-information originate
address-family BGP command.
The default route must first exist in the routing table (RIB) using either IGP or static routing. Then, You can use a static default route to null0. After that, use the redistribute static route-map
command to redistribute the static default route.
Default Route Using the Neighbor Default-Originate Command
Using this method, the BGP router doesn’t add the default route into the local BGP table; instead, it causes the advertisement to the specified neighbor (BGP peer).
neighbor a.b.c.d
address-family ipv4 unicast
default-originate [route-map route-map-name]
By default, this method doesn’t check if the default route exists in the routing table.
The referenced route map examines the entries in the IP routing table (not the BGP table). Therefore, if a route map permit clause is matched, the default route is advertised to the neighbor. So, the route map can be used to track the default route or any other route in the local routing table to be used as a condition for the advertisement.
References