A story about BGP Community
What is BGP COMMUNITY?
It is a BGP attribute that is optional & transitive which is passed to BGP peers. It is a numerical value that is assigned to specific prefix & advertised to neighbours. Neighbours that receives it will inpsect the community the value & take action whether its filtering or modifying other attributes.
Note: By default community attribute is removed from update before sent to the neighbor. neighbor x.x.x.x send-community must be applied to allow community values to be sent to specific neighbor.
Each standard community is a 32-bit value. They are often broken into two 16-bit values, to make them easier to read. For example, the community 4259840100 is the same thing as 65000:100. Often the first 16-bits represent the AS, and the second 16-bits are a custom value.
Well-known BGP Communities
- No-Advertise Community: When this community is attached to the route by the BGP Speaker; it will not advertise the route to any internal or external BGP peers.
2. No-Export Community: Router does not advertise the route to external peers. It only advertise to internal peers.
3. Local AS Community: To avoid BGP routing loops to happen in IBGP; routes from internal peers will not be advertised if it is received from an IBGP peer. In order to advertise these route sub-AS can be assigned by using confederation which the peers will act as EBGP peers. Let’s say in this setup the router does not want to advertise the routes it can do so using this community.
4. Graceful Shutdown Community: Lets say a router is on of the transit router to the next hop. This router needs to rebooted for an upgrade. This community can be issued towards the source router to switch the path with minimal impact.
5. Internet: This advertises routes to all neigbors.
8-byte value divided into 2 main sections:
First 2 bytes: Specifies community type
Last 6 bytes: Provides unique info specific to the community type.
3 fields: Type, Administrator & Assigned Number (type:administrator:assigned-number)
Based on the value of high-order byte in the Type field, the administrator field can be an AS or IP Address.
Mostly Extended Communities are used in MPLS-VPN & it uses 2 of it.
Route Target Community: Identifies routers that can receive specific set of routes.
Route Origin Community: Identifies routers that inject set of routes into BGP.
Note: A Virtual Routing & Forwading (VRF) is a virtual routing table that is separate than the global routing table that list all the available routes used for routing. In VRF, the virtual routing table segments route entries for customers & doesnt mix with the global routing table. This means routing policies can be attached with VRF & kept separated from other customers.
Route Target Community
This is used in a MPLS VPN environment to separate customers routing table. Refer to the example below:
There are 2 VRF here, named RED & BLUE. Each of the VRF has its own route-target information. We can see here R1 & R12 is in the VRF RED while R22 & R11 is in the VRF BLUE.
Assuming a route is advertised by R1 using VRF RED, R12 will be able to receive it because it also has VRF RED. But both R22 & R11 will not accept the advertised route because VRF RED is not stored in it.
Route Origin Community
The route origin community is used in a MPLS VPN environment to identify where routes originated from. This is to avoid readvertisment back to the site.
PE1 receives the route from CE1, besides the route-target that is attached to the route (using export), it also attaches the route origin community.
The route reaches PE2, but PE2 does not advertise it to CE2, because it knows that it came from the site.