The path shown in the output of the show ip bgp command shows AS1 five times, and this is correct. If no prepending was to take place, then the output would show AS 1 only once. So with the set as prepend 1 1 1 1 we are adding AS1 four times to the already existing path list of one. Therefore there should be the original AS1, plus an additional four, resulting in five ones.
I have 2 routers
Router 1 advertising subnet : 192.168.100.0/24 with community 65490:500 when SLA is OK and advertising the same subnet with community 65490:400 when SLA is not OK.
When router 2 receives the community from Router 1 depending on the community âŚcan router 2 make decision based on the recieved communities and send a community back to router 1. if router 2 receives a community of 65490:500 , then it should be able to send the community of 65490:501 back to router 1 and if it recieves the community of 65490:400 , then it should be able to send a community of 65490:401 to router 1 ?
It depends on what you mean when you say âcan router 2 send a community back to router 1â. Using route maps, it is possible to set a community based on the community that has been received. Route maps can match BGP community lists directly using the match community command under the route map configuration. You can then set a community based on that match statement.
If you take a look at this lesson, you will see an example of how to use route maps to set communities. You can modify this configuration to achieve what you described in your post.
Do we have to learn these community value like 64984:0 for AS path prepending and remaining mentioned by you from Layer 3 ISP, if not then how could we choose value?
I am unable to understand the given policy b/c there is no prefix/network in that case how could I read it, please elaborate the command one by one?
On ISP1 I tried to set to routemap on the incomming interface from customer one instead of outgoing to IPS2, because I thought it would give a similar result, but with the 10.10.10.10 prefix already having AS 1 prepended 4 times BEFORE sending it to ISP2.
While it does not show AS 1 added 4 times when I view it with show ip bgp like I would have expected, it not even the case on ISP2. So nothing happens basically.
How does this not work?
(So to be clear I did neighbor 192.168.10.10 route-map PREPEND_EU in instead of neighbor 192.168.12.2 route-map PREPEND_EU out on ISP1)
These BGP communities are 32-bit values that are divided in two sections. For labs you can pick whatever values you like but normally the first 16 bits are used to indicate the AS number that originates the community, the next 16 bits are assigned by the AS.
You do not need to memorize any of these numbers.
The policy used in the lesson does not need to mention a prefix/network, since the only matching criteria is the community list. So this route map matches ALL prefixes that contain the specific community parameter.
I tried to replicate your results, but I was unable to. What I did was I removed the following command from the BGP configuration of ISP1:
neighbor 192.168.12.2 route-map PREPEND_EU out
âŚand I replaced it with the following command:
neighbor 192.168.10.10 route-map PREPEND_EU in
The result was that the prepending of the ASâes takes place as the BGP update comes into ISP1, so I see the prepended ASâes within the BGP table of both ISP1 as well as ISP2 as expected. Actually, it took a little bit of time (about 30 seconds) before the BGP table of ISP1 was updated.
You may want to check your configuration again? Let us know how your troubleshooting goes.
Hi @lagapidis Arenât the BGP communities and extended communities optional transitive? Why have you mentioned BGP communities as âwell knownâ ? Please correct me if I am wrong.
When we talk about âwell knownâ communities, we are simply saying that there are four predefined communities in BGP. These are known as:
Internet
No-Advertise
No-Export
Local-AS
These are further described in the lesson. They are well-known in the sense that they have built-in commands that you can use to activate them simply because they are used quite often. For example, the No Advertise community can be
Furthermore, RFC1997 describes these well-known communities as those that âhave global significance and their operations shall be implemented in any community-attribute-aware BGP speaker.â
BGP communities and extended communities are indeed transitive, however, they are not optional. Even if you configure no community in your implementation, by default, you are using the âInternetâ well-known community, which simply advertises the prefix to all BGP neighbors.
For more information on community types and community propagation, take a look at this NetworkLessons Note on BGP community types.
In my lab a single router is acting as ASBR with OSPF on one leg and BGP into other. I am trying to match the Router ID of the router that send OSPF routes and set the community string over BGP, is this technically possible ?
Regards,
Dhruv
It is possible to create a route map that will set the community string for particular prefixes it sends to its BGP neighbors. This can be done by using the match ip route-source route-map command where the OSPF router ID is the route source.
You can then set the community of those prefixes that are sent from the desired route source (OSPF router ID) to whatever you like.
For more info on setting BGP communities using a route map take a look at this lesson:
For more info on route maps in general, take a look at this lesson:
Thank you for your response, but for some reasons after configuring my OSPF connections are not distributed now.
#########################################
!
access-list 10 permit host 16.16.16.16
!
route-map N7K-NDC-OSPF permit 20
match ip route-source 10
set community 64700:2
!
router bgp 64700
bgp log-neighbor-changes
network 11.0.0.0
redistribute ospf 1 route-map N7K-NDC-OSPF
neighbor 11.11.11.12 remote-as 65440
!
ip bgp-community new-format
!
###############################
N7K-SiteA#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
16.16.16.16 1 FULL/DR 00:00:35 15.15.15.16 GigabitEthernet3
1.1.1.1 1 FULL/BDR 00:00:39 10.10.10.10 GigabitEthernet2
The route map you have configured matches all prefixes that come from your neighboring OSPF router with ID 16.16.16.16, and assigns the appropriate community to that prefix. However, by applying that route map to the redistribution into BGP, this route map also filters all other OSPF prefixes from being redistributed. Remember that a route map always has an implicit deny-all at the end. You must add a second command entry to the route map to allow everything else to go through, without changing the community. This command would resolve your issue:
Is the explained community is standard type?
I am asking about the type
As we know there is 4 types in well-know and 2 types in private community .
Which type this one?
The lesson speaks about BGP communities in general, and it points out that there are four well-known BGP communities. When you say standard type, do you mean well-known?
These are the well known communities:
Internet: advertise the prefix to all BGP neighbors.
No-Advertise: donât advertise the prefix to any BGP neighbors.
No-Export: donât advertise the prefix to any eBGP neighbors.
Local-AS: donât advertise the prefix outside of the sub-AS (this one is used for BGP confederations).
In the lesson, all four are mentioned. When you say âwhich type is this one?â which âoneâ are you talking about?