cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
276
Views
5
Helpful
0
Replies
Highlighted
Beginner

Setting BGP community for Generated Prefixes

Hi guys!

 

I've worked with JunOS in the recently past, and now I need to set community at the aggregate prefixes generated, to classify the summary level (based in length mask). I tried to use "attribute-map" unsuccessfully. The IOS is the "L3-ADVENTERPRISE9-15.5.2T.bin" (Cisco IOL).Below the 2 scenarios, where I can successfully set the community using the "Option-2" (using tag feature). How could I use the "attribute-map" to make it? Thanl you in advance.

 

############################ OPTION-1 ############################

ip bgp-community new-format
!
ip community-list standard COMM-AGG-N1 permit 100:11
ip community-list standard COMM-AGG-N2 permit 100:12
ip community-list standard COMM-AGG-N3 permit 100:13
!
route-map AGG-N1 permit 10
set community 100:11 additive
!
route-map AGG-N2 permit 10
set community 100:12 additive
!
route-map AGG-N3 permit 10
set community 100:13 additive
!
!
route-map T1-IPV4-OUT permit 10
match community COMM-AGG-N1
!
router bgp 100
bgp router-id 10.0.0.1
bgp log-neighbor-changes
neighbor eBGP-IPV4 peer-group
neighbor eBGP-IPV4 remote-as 200
neighbor eBGP-IPV4 ebgp-multihop 2
neighbor eBGP-IPV4 update-source Loopback0
neighbor eBGP-IPV4 version 4
neighbor 20.20.20.1 peer-group eBGP-IPV4
!
address-family ipv4
aggregate-address 10.0.0.0 255.255.0.0 as-set attribute-map AGG-N1
aggregate-address 10.0.0.0 255.255.128.0 as-set attribute-map AGG-N2
aggregate-address 10.0.128.0 255.255.128.0 as-set attribute-map AGG-N2
aggregate-address 10.0.0.0 255.255.224.0 as-set attribute-map AGG-N3
aggregate-address 10.0.32.0 255.255.224.0 as-set attribute-map AGG-N3
aggregate-address 10.0.64.0 255.255.224.0 as-set attribute-map AGG-N3
aggregate-address 10.0.96.0 255.255.224.0 as-set attribute-map AGG-N3
neighbor eBGP-IPV4 send-community both
neighbor eBGP-IPV4 route-map T1-IPV4-OUT out
neighbor 20.20.20.1 activate
exit-address-family
!
!

 

############################ OPTION-2 ############################


ip bgp-community new-format
!
ip community-list standard COMM-AGG-N1 permit 100:11
ip community-list standard COMM-AGG-N2 permit 100:12
ip community-list standard COMM-AGG-N3 permit 100:13
!
ip route 10.0.0.0 255.255.0.0 Null0 tag 11 name AGG-N1
ip route 10.0.0.0 255.255.128.0 Null0 tag 12 name AGG-N2
ip route 10.0.128.0 255.255.128.0 Null0 tag 12 name AGG-N2
ip route 10.0.0.0 255.255.224.0 Null0 tag 13 name AGG-N3
ip route 10.0.32.0 255.255.224.0 Null0 tag 13 name AGG-N3
ip route 10.0.64.0 255.255.224.0 Null0 tag 13 name AGG-N3
ip route 10.0.96.0 255.255.224.0 Null0 tag 13 name AGG-N3
!
!
route-map SET-COMM permit 10
match tag 11
set community 100:11
!
route-map SET-COMM permit 20
match tag 12
set community 100:12
!
route-map SET-COMM permit 30
match tag 13
set community 100:13
!
route-map T1-IPV4-OUT permit 10
match community COMM-AGG-N1
!
router bgp 100
bgp router-id 10.0.0.1
bgp log-neighbor-changes
neighbor eBGP-IPV4 peer-group
neighbor eBGP-IPV4 remote-as 200
neighbor eBGP-IPV4 ebgp-multihop 2
neighbor eBGP-IPV4 update-source Loopback0
neighbor eBGP-IPV4 version 4
neighbor 20.20.20.1 peer-group eBGP-IPV4
!
address-family ipv4
network 187.0.0.0 route-map SET-COMM
network 187.0.0.0 mask 255.255.128.0 route-map SET-COMM
network 187.0.0.0 mask 255.255.224.0 route-map SET-COMM
network 187.0.32.0 mask 255.255.224.0 route-map SET-COMM
network 187.0.64.0 mask 255.255.224.0 route-map SET-COMM
network 187.0.96.0 mask 255.255.224.0 route-map SET-COMM
network 187.0.128.0 mask 255.255.128.0 route-map SET-COMM
neighbor eBGP-IPV4 send-community both
neighbor eBGP-IPV4 route-map T1-IPV4-OUT out
neighbor 20.20.20.1 activate
exit-address-family
!
0 REPLIES 0