There are 3 ways of advertising default route in BGP.
Method 1: Using network 0.0.0.0 command. It requires only that the route 0.0.0.0 is present in the Interior Gateway Protocol (IGP) routing table. This is the preferred approach.
Method 2: Using default-information originate command. It requires explicit redistribution of the route 0.0.0.0. This protects against someone accidentally redistributing a default route in BGP which could potentially be disastrous.
Method 3: Using neighbor default-originate command. This method does not require the presence of the 0.0.0.0/0 network in the routing table of the advertising router.
Terminology: RIB – Routing Information Base FIB – Forwarding Information Base
RIB This is a routing protocols database of routing prefixes that could potentially be installed in the routing table. Derived from the control plane, it is not used for forwarding. Every protocol such as OSPF, EIGRP, BGP has its own RIB and select their best candidates to try to install to global RIB so that it can then be selected for forwarding. Is a selection of routing information learned via static definition or a dynamic routing protocol. EX: show ip ospf databse show ip eigrp topology show ip bgp etc
FIB The actual information that a routing/switching device uses to choose the interface that a given packet will use for egress. Used for forwarding, information is derived from the RIB and from adjacency tables so that the packet can be rewritten with the correct encapsulation. Is programmed by one or more RIB. EX: show ip cef
When a Router receives a BGP UPDATE packet that contains Network Layer Reachability Information (NLRI) – this is, a route; the packet is processed in the next order:
– Step 1. BGP checks for the NLRI (prefix received) against any BGP inbound filter configured on the Router.
– Step 2. If the NLRI is not filtered, the prefix can be seen in the BGP table with the show ip bgp command.
– Step 3. If the Routing Table already has the same prefix/prefix-length entry with a lower Administrative Distance (AD) as seen in show ip route, BGP marks the route received with RIB-Failure.
*You can display BGP routes that are not inserted in the IP routing table with the show ip bgp rib-failure command, which also explains why the BGP route was not inserted in the IP routing table.
*all routes shown in show ip bgp rib-failure command will still advertised to all BGP peers.
*Network Layer Reachability Information (NLRI)
The Network Layer Reachability Information (NLRI) is exchanged between BGP routers using UPDATE messages. An NLRI is composed of a LENGTH and a PREFIX. The length is a network mask in CIDR notation (eg. /25) specifying the number of network bits, and the prefix is the Network address for that subnet.
The NLRI is unique to BGP version 4 and allows BGP to carry supernetting information, as well as perform aggregation.
The BGP aggregate-address can be used to summarise a set of networks into a single prefix. For this post, I just wanted to show the difference between aggregate-address and aggregate-address with summary only.
We have below topology. I’m going to summarise prefixes in R1.
Most of the time in a small network, we will be using the Layer 3 device as a default gateway and a DHCP server. And most of the time also, we will be excluding the gateway’s ip address from the dhcp pool. Just to save 1 more configuration line and for the sake of knowledge, the IP address configured on the router interface is automatically excluded from the DHCP address pool :). You need to exclude addresses from the pool if the DHCP server should not allocate those IP addresses.