09-12-2017 08:40 PM - edited 03-05-2019 09:07 AM
example,
route BGR prefix has community-list 65400:100 65500:65500 65535:65535 local-as
how can we strip one or more of them to make it become like
65500:65500 65535:65535 local-as
or
65400:100 65500:65500 65535:65535
09-13-2017 07:06 PM
any one know about this ?
09-13-2017 10:48 PM
09-14-2017 01:31 AM
Out of curiosity, I hav labbed Colin's suggestion, and it works perfectly:
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.252
speed auto
duplex auto
!
router bgp 1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 192.168.1.0 mask 255.255.255.252
neighbor 192.168.1.2 remote-as 2
neighbor 192.168.1.2 send-community
neighbor 192.168.1.2 route-map SET_COMMUNITY out
!
ip bgp-community new-format
!
ip prefix-list 1 seq 5 permit 1.1.1.1/32
!
route-map SET_COMMUNITY permit 10
match ip address prefix-list 1
set community 65400:100 65500:65500 local-AS 65535:65535
R2
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.252
speed auto
duplex auto
!
router bgp 2
bgp log-neighbor-changes
network 192.168.1.0 mask 255.255.255.252
neighbor 192.168.1.1 remote-as 1
neighbor 192.168.1.1 route-map MODIFY_COMMUNITY in
!
ip bgp-community new-format
!
ip community-list expanded REMOVE_COMMUNITY permit 65400:100
!
ip prefix-list 1 seq 5 permit 1.1.1.1/32
!
route-map MODIFY_COMMUNITY permit 10
match ip address prefix-list 1
set comm-list REMOVE_COMMUNITY delete
R2#sh 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, not advertised outside local AS)
Not advertised to any peer
Refresh Epoch 1
1
192.168.1.1 from 192.168.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 65500:65500 local-AS 65535:65535
rx pathid: 0, tx pathid: 0x0
When the community list matches 'local-AS', that attribute is removed:
ip community-list expanded REMOVE_COMMUNITY permit local-AS
R2#sh 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)
Not advertised to any peer
Refresh Epoch 1
1
192.168.1.1 from 192.168.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: 65400:100 65500:65500 65535:65535
rx pathid: 0, tx pathid: 0x0
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide