BGP Quick Guide : how to clear the BGP routing table, and speedup the convergence
it's may be a good practice to clear the routing table to speed up the BGP table Convergence process, but how ?
well there are plenty of options,
1) Hard clear of the neighbor :
- clear ip bgp <A.B.C.D> (ex, R1#clear ip bgp 18.104.22.168 )
- clear ip bgp * (* = all neighbors and not just one.)
this option clears the BGP neighbor relationship (removes the neighboring relationship then negotiate it again. )
this option may be Okay for the exam environment , but this may never be the best solution the real environment , why not ??
well , because the BGP internet table might be a 100's of thousands of Paths (IP addresses) , so if you hard clear the neighbors , you will lose all your routes and neighboring relationship, and will have to wait for BGP to renegotiate the neighboring relationship.
2) soft Clear :
- clear ip bgp * in (clears only inbound updates, asking the neighbor to send updates again)*
- clear ip bgp * out (clears it's outbound updates, sending the neighbor newer updates )
- clear ip bgp <A.B.C.D> soft (this command clears both inbound and outbound updates)
- clear ip bgp <A.B.C.D> soft in (clears only inbound updates, asking the neighbor to send updates again)*
clear ip bgp <A.B.C.D> soft out (clears it's outbound updates, sending the neighbor newer updates )*
soft clear is basically a clearing of the routing table either inbound or outbound (performing what is called a "Route Refresh"), requesting newer updates from the neighboring BGP table (when used inbound) or sending newer updates from our Local BGP table to our neighbors (when used outbound)
Note: there's nothing special about the outbound behavior other than what i explained
Inbound Behavior explained in depth :
(the previous description of soft reconfiguration is the default behavior when the "soft-reconfiguration inbound" feature is NOT activated)
When soft-reconfiguration inbound is activated :
when this option(or feature) is activated, the router will create a backup of the routes received from his neighbor(s) before applying any filters or features to those routes. (let's call this backup table the "SOFT TABLE")
so when you initiate a soft clear to the neighbor(s) (as shown in the commands above) then the router initiating the command will do the following steps
- check the if there are any filters or route-maps toward that neighbor.
- instead of sending a request of a refresh(asking the neighbor for updates
again,hence Route-Refresh), the route will instead only use his "SOFT TABLE" and
apply those filters(from step one, if existed) to the routes in the "SOFT TABLE"
now the million dollar Question : HOW DO I ACTIVATE soft-reconfiguration inbound ?
simple, here's how
neighbor <A.B.C.D> soft-reconfiguration inbound
although there are more clear options for the BGP protocol, i have only describe the protocols relevant to the CCNP Blueprint, or CCIE for IPv4 Address-family.
If you need me, @Bugazia Me, and i'll be there .