Reset Search
 

 

Article

How to filter distribution of BGP routes (matching prefix lists) to neighbors using the 'Community' attribute of the BGP routing protocol

« Go Back

Information

 
TitleHow to filter distribution of BGP routes (matching prefix lists) to neighbors using the 'Community' attribute of the BGP routing protocol
Objective
To filter distribution of BGP routes (matching prefix lists) using the 'Community' attribute of the BGP protocol
Environment
  • Netiron
  • MLX/XMR
  • CER/CES
Procedure
  1. Create a prefix list that permits the route that needs to not be filtered:
    telnet@MLX(config)#ip prefix-list TEST seq 5 permit 7.7.7.0 255.255.255.0
  2. Create a route map:
    telnet@MLX(config)#route-map TEST permit 10
  3. 'Match' the created prefix list to a route map:
    telnet@MLX(config-routemap TEST)#match ip address prefix-list TEST
  4. 'Set' or assign one/multiple community/communities (based on the AS number/s of the neighbor/s intended) to the created route map:
    telnet@MLX(config-routemap TEST)#set community 100:6666 300:6667
  5. Under the BGP configuration, specify the route map and the direction the filter needs to be applied (inbound/outbound):
    telnet@MLX(config-bgp)#neighbor 192.168.10.1 route-map [in|out] TEST
  6. Verify sent route and associated community at the local router:
    telnet@MLX#sh ip bgp neighbor 192.168.10.1 advertised-routes detail
    		       There are 1 routes advertised to neighbor 192.168.10.1
    		Status A:AGGREGATE B:BEST b:NOT-INSTALLED-BEST E:EBGP I:IBGP L:LOCAL
    		1       Prefix: 7.7.7.0/24,  Status: BL,  Age: 0h4m13s
    		         NEXT_HOP: 192.168.10.2, Learned from Peer: Local Router
    		          LOCAL_PREF: none,  MED: 0,  ORIGIN: incomplete,  Weight: 32768
    		         AS_PATH: 200 
    		            COMMUNITIES: 100:6666
    		            Adj_RIB_out count: 4,  Admin distance 1
  7. Verify received route and associated community at the remote router:
    telnet@DUT3#sh ip bgp route detail 7.7.7.0
    		Number of BGP Routes matching display condition : 1
    		Status A:AGGREGATE B:BEST b:NOT-INSTALLED-BEST C:CONFED_EBGP D:DAMPED
    		       E:EBGP H:HISTORY I:IBGP L:LOCAL M:MULTIPATH m:NOT-INSTALLED-MULTIPATH
    		      S:SUPPRESSED F:FILTERED s:STALE x:BEST-EXTERNAL
    		1       Prefix: 7.7.7.0/24, Rx path-id:0x00000000, Tx path-id:0x00010001, rank:0x00000001, Status: BEx,  Age: 0h1m56s
    		         NEXT_HOP: 192.168.10.2, Metric: 0, Learned from Peer: 192.168.10.2 (200)
    		          LOCAL_PREF: 100,  MED: 0,  ORIGIN: incomplete,  Weight: 0,  GROUP_BEST: 1
    		         AS_PATH: 200
    		            COMMUNITIES: 100:6666 
    		            Adj_RIB_out count: 1,  Admin distance 20
    		       Last update to IP routing table: 0h1m56s, 1 path(s) installed:
    		       Route is to be sent to 1 peers:
    		        192.168.1.2(200)
Additional notes

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255