BGP Key Commands Shows and Debugs Router bgp 200 <- 200 is the AS number Network 20.1.0.0 MASK 255.255.0.0 Neighbor 10.1.1.1 remote-as 100 <- EBGP peer Neighbor 20.1.1.1 remote-as 200 <- IBGP peer Aggregate-address 20.0.0.0 255.0.0.0 as-set Neighbor 10.1.1.1 route-reflector-client Neighbor 10.1.1.1 next-hop-self Neighbor 10.1.1.1 ebgp-multihop Confederations router bgp 6001 bgp confederation identifier 666 bgp confederation peers 6002 6003 neighbor 171.69.232.55 remote-as 6002 neighbor 171.69.232.56 remote-as 6003 neighbor 160.69.69.1 remote-as 777 neighbor 10.1.1.1 update-source loopback 0 For IBGP peers only, selects loopback as source int. Good for robustness. Show ip bgp summary Show ip bgp Show ip bgp neighbor Debug ip bgp events Debug ip bgp updates Clear ip bgp * Show ip bgp filter-list Show ip bgp paths Communities: Router bgp 100 neighbor 171.69.232.50 remote-as 200 neighbor 171.69.232.50 send-community neighbor 171.69.232.50 route-map set-community out route-map set-community 10 permit match address 1 set community no-export route-map set-community 20 permit match address 2 Additional Commands Local pref manipulation: Access-list 1 permit 10.0.0.0 0.255.255.255 Route-map setlocalpref permit 10 Match ip address 1 Set local-preference 200 Route-map setlocalpref permit 20 Set local-preference 100 Neighbor 193.1.1.1 route-map setlocalpref in MED: Access-list 1 permit 10.0.0.0 0.255.255.255 Route-map setmed permit 10 Match ip address 1 Set metric 10 Route-map setmed permit 20 Set metric 50 Neighbor 193.1.1.1 route-map setmed in Aggregate-address 160.0.0.0 255.0.0.0 Regular expressions: . matches any single character * matches 0 or more sequence of a given pattern .* match any pattern ^ beginning of a string $ end of a string _ beginning of a string, end of string or delimiter (space, comma) ip as-path access-list 1 deny _300$ ip as-path access-list 1 permit .* neighbor 10.1.1.1 filter-list 1 out or in attribute manipulation: route-map setlocal permit 10 match as-path 1 set local-preference 100 … Spot The Issue Notes • IBGP peers MUST be fully meshed, or otherwise must use a route-reflector or confederation • EBGP peers must be directly connected, otherwise must use ebgp-multi-hop • Next hop reacheability does not change within the AS. Therefore, IBGP must be able to reach the next hop, route normally learned via IGP. Otherwise, use next-hop-self at the AS border • TURN ON "NO SYNC" IN THE AS, otherwise will need to redistribute BGP into the IGP • Distribute-list in and out are applied with a NEIGHBOR STATEMENT!! IOS will let you apply a normal "distribute-list 1 in serial 0" but it won't do squat! Golden Rule: Never advertise a router that you don't know how to get to. Use "show ip route" and "show ip bgp" to compare BGP advertisements and posted routes. Check next-hop-reacheability localpref, weight are applied on incoming or EBGP connections. MED is applied on outgoing EBGP connections. Highest local preference wins. In AS only. Lowest MED wins. Inter AS only. Standard communities: Internet: advertise to all routers No-export: do not advertise to EBGP peers No-advertise: do not advertise to any peers (internal or external) local-as: Adv to IBGP or confederation peers . loopback 0 For IBGP peers only, selects loopback as source int. Good for robustness. Show ip bgp summary Show ip bgp Show ip bgp neighbor Debug ip bgp events. neighbor Debug ip bgp events Debug ip bgp updates Clear ip bgp * Show ip bgp filter-list Show ip bgp paths Communities: Router bgp 100 neighbor 171.69.232.50