As keith barker said in his BGP Lesson “community is just number there is No meaning”, but if we are well configuring it’s would be very handy and used full for manipulate path selection in our BGP networking topology. A customer who is multi-homed to a service provider can often use communities to tell the service provider how to route traffic to the customer autonomous system (AS).
Assume R3 is our Router and R1 is Provider Site
R3
R3#sh run | s bgp router bgp 345 no synchronization R3#sh run | s bgp router bgp 345 !!! 6.6.6.6 is my other neighboor to adv some route neighbor 6.6.6.6 remote-as 67 neighbor 6.6.6.6 ebgp-multihop 2 neighbor 6.6.6.6 update-source Loopback0 neighbor 6.6.6.6 next-hop-self !!! 172.16.13.1 are R1 ip address who act as SP in this LAB neighbor 172.16.13.1 remote-as 11 neighbor 172.16.13.1 ttl-security hops 2 neighbor 172.16.13.1 send-community neighbor 172.16.13.1 route-map SETCOM out R3(config)#ip bgp-community new-format !! this is used full to see our Community in human language 🙂
R3#sh route-map route-map SETCOM, permit, sequence 10 Match clauses: ip address prefix-lists: SETCOM_PREF Set clauses: community 3:200 Policy routing matches: 0 packets, 0 bytes route-map SETCOM, permit, sequence 20 Match clauses: Set clauses: Policy routing matches: 0 packets, 0 bytes R3#sh pref SETCOM_PREF R3#sh ip pref SETCOM_PREF ip prefix-list SETCOM_PREF: 1 entries seq 5 permit 192.66.11.0/24
R1
now we see in R1 as our service provider it’s advertise R3 community
R1#sh ip bgp 192.66.11.0 BGP routing table entry for 192.66.11.0/24, version 120 Paths: (2 available, best #2, table Default-IP-Routing-Table) Flag: 0x820 Advertised to update-groups: 1 22 3 172.16.12.2 from 172.16.12.2 (2.2.2.2) Origin IGP, localpref 100, valid, external 3 172.16.13.3 from 172.16.13.3 (192.168.1.2) Origin IGP, localpref 100, valid, external, best Community: 3:200
Now as we mention before we can do a path selection in this lab I used local preferences to 200 for community 3:200 on R1
R1(config)#ip community-list standard LOCPREFF permit 3:200
R1(config)#do sh run | s route-map neighbor 172.16.13.3 route-map LOCAL_PREF in route-map SETMED permit 10 match ip address prefix-list SETMED route-map LOCAL_PREF permit 10 match community LOCPREFF set local-preference 200 route-map LOCAL_PREF permit 20
R1(config)#do sh run | s router bgp router bgp 11 neighbor 172.16.13.3 remote-as 3 neighbor 172.16.13.3 ttl-security hops 2 neighbor 172.16.13.3 send-community neighbor 172.16.13.3 route-map LOCAL_PREF in
verify now:
R1#sh ip bgp 192.66.11.0 BGP routing table entry for 192.66.11.0/24, version 0 Paths: (1 available, no best path) Not advertised to any peer 3 172.16.13.3 from 172.16.13.3 (192.168.1.2) Origin IGP, localpref 200, valid, external Community: 3:200
this is capture from sho ip bgp
*> 172.16.13.3 200 0 3 i