BGP – How to display incoming/outgoing routes before/after filtering
- Friday, June 20, 2008, 8:28
- Study Guide
- 661 views
- Add a comment
Below you’ll find some simple BGP commands that you can use in order to check your policy-control rules (filter-list, distribute-list, route-map, etc.) locally, when you don’t have access to the peer neighbor.
This is our initial network….
Incoming Routes : Before filtering (soft-reconfiguration in must be enabled *)
R1#sh ip bgp nei 10.10.10.2 received-routes % Inbound soft reconfiguration not enabled on 10.10.10.2 R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router bgp 1 R1(config-router)#neighbor 10.10.10.2 soft-reconfiguration inbound R1#sh ip bgp nei 10.10.10.2 received-routes BGP table version is 8, local router ID is 1.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 20.20.0.0/16 10.10.10.2 0 0 2 i *> 20.20.20.0/24 10.10.10.2 0 0 2 i Total number of prefixes 2
Incoming Routes : After filtering
R1#sh ip bgp nei 10.10.10.2 routes
BGP table version is 8, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 20.20.0.0/16 10.10.10.2 0 0 2 i
*> 20.20.20.0/24 10.10.10.2 0 0 2 i
Total number of prefixes 2
Outgoing Routes : Before filtering
R1#sh ip bgp
BGP table version is 8, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.0.0.0 0.0.0.0 32768 i
*> 1.1.0.0/16 0.0.0.0 32768 i
s> 1.1.1.0/25 0.0.0.0 0 32768 i
*> 1.1.1.0/24 0.0.0.0 32768 i
*> 20.20.0.0/16 10.10.10.2 0 0 2 i
*> 20.20.20.0/24 10.10.10.2 0 0 2 i
Outgoing Routes : After filtering
R1#sh ip bgp neighbors 10.10.10.2 advertised-routes
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.0.0.0 0.0.0.0 32768 i
*> 1.1.0.0/16 0.0.0.0 32768 i
*> 1.1.1.0/24 0.0.0.0 32768 i
Time to add some filtering….
Let’s apply an inbound prefix-list first:
R1(config)#ip prefix-list R2-IN permit 20.20.0.0/16 R1(config)#router bgp 1 R1(config-router)#neighbor 10.10.10.2 prefix-list R2-IN in
Do an inbound soft reconfig :
R1#clear ip bgp 10.10.10.2 soft inDonwload Free PassGuide Braindumps-The Most Realistic Practice Questions and Answers,Help You Pass any Exams
Incoming Routes : Before filtering
R1#sh ip bgp nei 10.10.10.2 received-routes
BGP table version is 10, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 20.20.0.0/16 10.10.10.2 0 0 2 i
* 20.20.20.0/24 10.10.10.2 0 0 2 i
Total number of prefixes 2
Incoming Routes : After filtering
R1#sh ip bgp nei 10.10.10.2 routes
BGP table version is 10, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 20.20.0.0/16 10.10.10.2 0 0 2 i
Total number of prefixes 1
So filtering works fine on the inbound.
Let’s apply an outbound prefix-list now :
R1(config)#ip prefix-list R2-OUT permit 1.0.0.0/8 le 16 R1(config)#router bgp 1 R1(config-router)#neighbor 10.10.10.2 prefix-list R2-OUT out
Do an outbound soft reconfig
R1#clear ip bgp 10.10.10.2 soft out
Outgoing Routes : Before filtering
R1#sh ip bgp
BGP table version is 10, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.0.0.0 0.0.0.0 32768 i
*> 1.1.0.0/16 0.0.0.0 32768 i
s> 1.1.1.0/25 0.0.0.0 0 32768 i
*> 1.1.1.0/24 0.0.0.0 32768 i
*> 20.20.0.0/16 10.10.10.2 0 0 2 i
Outgoing Routes : After filtering
R1#sh ip bgp nei 10.10.10.2 advertised-routes
BGP table version is 10, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.0.0.0 0.0.0.0 32768 i
*> 1.1.0.0/16 0.0.0.0 32768 i
So filtering works fine on the outbound too.
You can also use the following commands in order to test your policy-controls on your BGP table before you actually apply them.
R1#sh ip bgp ? community Display routes matching the communities community-list Display routes matching the community-list filter-list Display routes conforming to the filter-list prefix-list Display routes matching the prefix-list quote-regexp Display routes matching the AS path "regular expression" regexp Display routes matching the AS path regular expression route-map Display routes matching the route-map
* : Because soft-reconfiguration creates an extra copy of all routes received per neighbor, you want to be careful when implementing this feature in a production network or a network with many routes/neighbors. Route-refresh is a much better solution; you just miss the functionality of viewing the incoming routes before filtering.
PassGuide Cisco Exams Questions & Training Materials
- Free BGP – Can an aggregate-address suppress another aggregate-address on the same router?
- Free How to filter OSPF routes that have the same source ip
- Free Topology: Multi-Homed VPN & Object Tracguide – IP SLA – Floating Default Routes PLUS OSPF Over GRE Tunnel
- Free passguide cisco CCIP 642-661
- Free Download New p4s cisco Composite ccnp 642-892 321 Q&As 4.52
- Free Topology: Multi-Homed VPN & Object Tracguide – IP SLA – Floating Default Routes
- Free How to pass RIP routes between spokes (connected through a hub subif)
- Free CCNA TechNote: IP Access Lists
- Free p4s cisco ccnp bsci 642-901 2.95 3.10
- Free passguide cisco 642-112
- Free [offer] Lab 9 – Routers & Packet Filters
- Free BGP Outbound Route Filtering (BGP ORF)
About the Author
Write a Comment
Gravatars are small images that can show your personality. You can get your gravatar for free today!

