BGP Community Attribute: Value That You Can Use For Your Own Policies
BGP Community Attribute: Value That You Can Use For Your Own Policies
A BGP community is bit of “extra information” that you can add to one of more prefixes
which is advertised to BGP neighbors.
There are 4 well known BGP communities that you can use or you can pick a numeric
value that you can use for your own policies.
It is widely used in telecommunication industries.
It is process of tagging the routes and sends it to neighbor. Neighbor will take decision
based on it.
Configuration
Assign IP address in whole topology and configure OSPF in all the routers.
On R6, On R7,
Conf t Conf t
Router bgp 10 Router bgp 20
Neighbor 170.10.1.1 remote-as 100 Neighbor 170.10.1.1 remote-as 100
Neighbor 170.10.1.1 update-source loopback 0 Neighbor 170.10.1.1 update-source loopback 0
Conf t
Int loopback 10
Ip address 10.1.1.1 255.255.255.0
Exit
Int loopback 11
Ip address 10.1.2.1 255.255.255.0
Exit
R#Sh ip bgp
R#Sh ip route
NO-EXPORT
Any route advertise with no-export community cannot be advertised outside AS or any EBGP
neighbors.
Ex. R6 will advertise 10.1.1.0/24 & 10.1.2./24 routes to R1 with no-export community. R1 will
advertise those routes to R2 & R3 only, R1 does not advertise those routes to R7 and R2 & R3 won’t
advertise them to R4 & R5.
Conf t
Access-list 10 permit 10.1.1.0 0.0.0.255
Access-list 10 permit 10.1.2.0 0.0.0.255
Router bgp 10
Neighbor 170.10.1.1 route-map NOEXP out
Neighbor 170.10.1.1 send-community
End
On R1,
Conf t
Router bgp 100
Neighbor 170.10.2.2 send-community
Neighbor 170.10.3.3 send-community
End
Conf t
Int loopback 20
Ip add 20.1.1.1 255.255.255.0
Exit
Int loopback 21
Ip add 20.1.2.1 255.255.255.0
Exit
Router bgp 20
Network 20.1.1.0 mask 255.255.255.0
Network 20.1.2.0 mask 255.255.255.0
End
Now On R7,
Conf t
Access-list 30 permit 20.1.1.0 0.0.0.255
Access-list 30 permit 20.1.2.0 0.0.0.255
Router bgp 20
Neighbor 170.10.1.1 route-map noadv out
Neighbor 170.10.1.1 send-community
End
Clear ip bgp * soft
Check on R6,R2,R3.
Sh ip bgp (You won’t get those routes)