BGP: Communities: No-Advertise
· In BGP, communities are basically used to tag the routes so that we can filter them where ever we want.
· NO-ADVERTISE is a Special Community value, simply it instructs the router, not to forward this route to any neighbor (not even to IBGP neighbor).
· Let me take a small topology to configure this
R1-------------------R2
· AS 100 : R1, R2
· R1 is advertising a prefix 1.1.1.1/32 into BGP with “no-advertise” community
· R1 will not forward this prefix to R2.
Let me configure it and see…
R1#show run
router bgp 100
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255 route-map NO-ADV
network 11.11.11.11 mask 255.255.255.255
neighbor 100.1.12.2 remote-as 100
no auto-summary
!
route-map NO-ADV permit 10
set community no-advertise
!
R2(config-router)#do show run
router bgp 100
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 100.1.12.1 remote-as 100
no auto-summary
!
R2(config-router)#
R1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 3, main routing table version 3
2 network entries using 234 bytes of memory
2 path entries using 104 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 734 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
100.1.12.2 4 100 253 254 3 0 0 04:10:00 0
R1#
R2#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 100
BGP table version is 2, main routing table version 2
1 network entries using 117 bytes of memory
1 path entries using 52 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 417 total bytes of memory
BGP activity 1/0 prefixes, 1/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
100.1.12.1 4 100 254 253 2 0 0 04:10:32 1
R2#
· Neighbor relationship is up
R1#show ip bgp
BGP table version is 3, 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.1.1.1/32 0.0.0.0 0 32768 i
*> 11.11.11.11/32 0.0.0.0 0 32768 i
R1#
R1#show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to any peer)
Not advertised to any peer
Local
0.0.0.0 from 0.0.0.0 (1.1.1.1)
Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
Community: no-advertise
R1#
R2#show ip bgp
BGP table version is 2, local router ID is 2.2.2.2
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
*>i11.11.11.11/32 100.1.12.1 0 100 0 i
R2#
Observations:
· 1.1.1.1/32 prefix is there only in R1’s BGP table.
· R1 didn’t advertise this prefix to R2
No comments:
Post a Comment