What does the Cisco clear bgp command do (Resetting BGP sessions)?

Опубликовано: 24 Март 2026
на канале: Sparkitec
67
0

What does the Cisco clear bgp command do? Lets start with BGP routers need to be configured with the right filters so packets don’t flow in directions they’re not supposed to flow. However, applying a filter to a BGP session that’s already established isn’t very effective; it’s a bit like closing the barn door after the animals have already left the barn. Resetting/clearing your BGP sessions is like herding all the animals back inside and then see which ones are allowed out by the filter and which ones aren’t. The clear bgp command kills the TCP session with your BGP neighbor, which forces it to restart and as a result, you'll receive all prefixes from your neighbor again. The router then initiates a new BGP session. When that session is established, all prefixes are transferred and the new filter is applied. A side effect of clearing BGP sessions in this manner is that connectivity to and from the neighboring network is lost for some time; typically between 10 and 30 seconds, but longer is also possible. Remote networks now have to reroute packets for your network over another path—assuming one is available. Clearing BGP sessions in this manner is not recommended. I’s best to avoid too many BGP resets and especially the “hard” resets described above.