BGP Default Route Origination
We can originate default route to specific BGP neighbor through
route bgp [AS No.] neighbor [ip address] default-originate
Note:-By doing this the Default route is originated to the BGP peer along with the other routes in the BGP table.If you want to advertise only Default-route then do backup your configuration with a prefix-list or access-list or route-map.
>>router bgp [AS No.] neighbor [ip address of neighbor] prefix-list ONLY_DEFAULT_ORIGINATE out
Your Prefix-list could look like this.
>>ip prefix-list ONLY_DEFAULT_ORIGINATE seq 5 permit 0.0.0.0/0
Here in the above prefix-list we are only permitting Default-route by “0.0.0.0/0” if we have taken “0.0.0.0/0 le 32” then all the routes including Default route will advertise to the neighbor.Do watch for the granular things while doing configurations in BGP.
Important thing:-One very important thing to remember to check the routing table of the IBGP neighbor where we are advertising the Default route,whether the route that we have redistributed into IBGP neighbor is installed into routing table or not.check with the command:-
>>sh ip route | inc 0.0.0.0
if the Neighbor routing table is already learing the default route from other IGP then do deny this route by access-list,suppose we have originated earlier a default route via ospf in the routing domain , it will look like this.
R1#sh ip route | include 0.0.0.0
Gateway of last resort is X.X.X.X to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via X.X.X.X, 00:33:11, FastEthernet1/12
Here we are already learing the default route from OSPF as the OSPF has lower Admin Distance(110) than IBGP(200) the default route via OSPF is installed in the routing table.
We can deny it in OSPF by.
>>router ospf 1
distribute-list PREFER_DEFAULT_VIA_BGP in
>>ip access-list standard PREFER_DEFAULT_VIA_BGP