Useful BGP commands on Cisco Routers

  • When BGP is not behaving correctly, a “trick” to temporarily stop peering with a neighbor is to use the following command:

    router bgp 194
    neighbor
    <ipaddress>

    password xxx

    Since the other router doesn’t have the same password, the two routers will stop talking to one another, without you having to do anything else. Later, when the problem is resolved, simply remove the line to reestablish peerage.

  • To see what routes you’re getting from an AS, use the command

    show ip bgp regexp <regluar-expression-for-an-AS>

  • To see what routes you’re getting from a neighbor, do

    show ip bgp vpnv4 vrf tr neighbors 192.43.217.133 received-routes
    show ip bgp vpnv4 vrf nlr neighbors 192.43.217.138 received-routes
    show ip bgp vpnv4 vrf nlr neighbors 216.24.184.25 received-routes

  • To see a quick status of all BGP, on a !non-vrf router and a vrf router,

    show ip bgp summary
    show ip bgp vpnv4 vrf tr summary

  • To see BGP routes, in the default table or an explicit VRF,

    show ip bgp
    show ip bgp vpnv4 vrf tr

  • To see what routes you’re getting from a neighbor, use one of these

    show ip bgp neighbor <IP-address-of-neighbor> routes
    show ip bgp vpnv4 vrf tr neighbor 192.43.217.133

  • To see what routes you’re sending to a neighbor, use the command

    show ip bgp neighbor <IP-address-of-neighbor> advertised-routes

  • To clear a BGP session:

    clear ip bgp <ip-address of neighbor>

  • To find out who owns, say, Autonomous System number 44, go to http://www.arin.net/ and type AS44. Or get file ftp://rs.arin.net/netinfo/asn.txt. Or Web to http://www.arin.net/docs.html.
  • To see what’s happening with BGP, use the commands

    terminal monitor
    debug ip bgp events

  • To show all the networks sourced by this AS

    show ip bgp regexp ^$