BGP Community Local AS

Hello Sai

If I understand correctly, you want R6 to receive the route to 1.1.1.1 via eBGP as an exception to the local AS feature. The only way to change the behaviour of the local AS feature is to change the community using a route map. If we were to do this as an incoming route map on the Gi0/2 interface of R3, then you could remove the local AS community from the route to 1.1.1.1 as the advertisement comes into R3, and it would be advertised to R6, but it would also be advertised to R5 which is not what we want.

In order to achieve what you are describing, we would have to not use local AS, but use no-advertise or no-export instead. You can see these two lessons below:



I hope this has been helpful!

Laz

Hello Laz

I was trying to see the ideal solution to following problem: R1 is trying to advertise its routes to R6 but the owner of AS2345 want to limit the routes of R1 only to the confederation AS23…I did think about using no-advertise but in case there are 20 routers in AS23 wouldn’t it be a bit complex solution?

Thanks
Sai

Hello Sai

In order to achieve this, I’m not sure that communities are the way to go. The problem is not the complexity or the number of routers, because confederations are used in order to reduce the number of peerings, making the resulting topology simpler. The problem with communities is that the community is associated with a particular prefix. As such, the prefix will be treated in the same way with all BGP neighbors without exception. There is no way to specify such an exception. Specifically, for the communities we’ve been talking about:

  1. A router that receives a prefix with a no advertise community will simply not advertise it to any other neighbor
  2. A router that receives a prefix with a no export community will advertise to iBGP peers but not eBGP peers
  3. A router that receives a prefix with a local AS community will only advertise within its own sub-AS

If you want to achieve what you have described, you must be more granular in your configuration. Such granularity is only provided by either access lists or route maps. More information about how these can be used to filter routes using BGP can be found at these lessons:



https://networklessons.com/bgp/bgp-prevent-transit-as

I hope this has been helpful!

Laz

Hi Laz,

Why don’t we doing configuration related to communication on R1 like we did for other communities? can we did here like we did for other communities and vise-versa?

Hello Pradyumna

I’m not sure I understand the question. Can you clarify?

Laz

I’m Japanese. Sorry for my poor English.
On R2, We activated OSPF, but as a try I deleted a network command between R1 and R2 using no network 192.168.12.0 0.0.0.255 area 0.
Then, on R5 and R6 with show ip bgp command, the network 1.1.1.1/32 advertised by R1 disappeared.
However, R3 and R4 still had a information about network 1.1.1.1/32 with show ip bgp command although they did not have no route for 192.168.12.0/24 either.
When I acivated “network 192.168.12.0 0.0.0.255 area 0” on R2, R5 and R6 again got a information about 1.1.1.1/32 with show ip bgp.

I don’t understand why this happens.

Sorry for my question being out of the lesson topic. Thanks.

Hello Masafumi

If you enable OSPF on R1, it will create an OSPF neighbor relationship with R2. Because OSPF is also running on R3, R4, and R5, OSPF will be used to advertise the 1.1.1.1/32 prefix. So what you are seeing is the prefix being shared via OSPF. Just to be clear, no IGP like OSPF should be used to advertise networks between routers in different AS’es. Only BGP should be used when advertising networks from one AS to another. Otherwise, unpredictable routing will take place.

Now when you remove this OSPF adjacency, the routes disappear. Now what is happening depends on various things. Remember that BGP takes a long time to converge, so it may be that what you are seeing is not the completely converged BGP situation. So when you input show ip bgp it may be showing information that has not yet been updated.

I suggest you attempt to recreate the lab as it is in the lesson, and use the clear ip bgp * command to force BGP to reconverge quickly, and see the results. If you find that you still have questions, feel free to let us know!

Don’t worry, your English is great and understandable! No problem at all!!

I hope this has been helpful!

Laz

1 Like

Hi Rene,

Would you be able to please explain what is bgp confederation identifier command and bgp confederation peers command are used for? and how does it work??

Hello Joed

These two commands are used in order to configure what are known as BGP confederations. These can be considered sub-ASes that create a hierarchical structure within a BGP AS. This is useful especially when you have extensively large BGP autonomous systems. These are explained in detail in the following lesson:

I suggest you go through that lesson first and then return to the BGP Community Local AS lesson to further understand the use of the local AS BGP community.

I hope this has been helpful!

Laz