cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5584
Views
5
Helpful
8
Replies

Different BGP neighbors same subnet.

arturmelyan
Level 1
Level 1

Hello,

 

I have attached a diagram and would like to get an advice regarding of the best practice configuration scenario.

Will it work properly if R1 is peered with R3 and R2 across the same subnet? 

What if I would filter on R3 some received network(e.g. 8.8.8.0/24) with higher local-pref and send it only to R1. Will R2 get this filtration policy as well? If so, then I should block it somehow on R2, right?

In my understanding it is better to make BGP peering with R3 through separate Vlan and with R2 through another separate Vlan in order to have a possibility in flexible configuration of filters, right?  

 

Any response would be so much appreciated.

8 Replies 8

Richard Burts
Hall of Fame
Hall of Fame

While it might be conceptually easier to think about different BGP neighbors in different subnets it is not true that it is easier to have flexible configuration of filters when neighbors are in different subnets. The filters can be configured and applied per neighbor and it makes no difference in the operation of the filter whether neighbors are in same subnet or different subnets.

 

HTH

 

Rick

HTH

Rick

Thank you for your response, Richard.

 

Could you please give me some details(example) about applying filters per neighbor?

Based on my diagram let's say I configure route-map:

route-map abc permit 10

  match ip address prefix-list abc

  set local-pref 200

 

ip prefix-list abc seq 10 permit 8.8.8.0/24

 

By applying this route-map to R3, the R2 will not get it? 

Hello,

 

in addition to Richard's remarks, you can have all routers in the same subnet as long as you make sure there is a full mesh (which in your scenario means each router has two iBGP neighbors). If you want to use local preference, you have to apply the route map inbound to both iBGP neighbors.

Thank you for your response, George

 

Yes, here is full mesh. R2 and R3 are iBGP peered too. and I wouldn't want that R2 gets Inbound filter from R3. 

Could you please give a configuration example? 

Based on the suggestions in your response we already have most of what we would need to apply a filter per neighbor. You have suggested a prefix list which identifies some network, and you have suggested a route map which uses that prefix list to match some traffic and will set local preference. The other thing you would need would be to apply that route map to one of the neighbors. You have suggested applying the route map to R3. You have not indicated whether you want this filter to operate inbound or outbound, and since the route map is setting local preference. So I assume that you would want the route map applied inbound. If you want it outbound that is a simple change. What you would need would be entered in router bgp configuration mode and might look something like this

neighbor <address of R3> route-map abc in  (or out depending on what you want to achieve)

This would apply the filter to R3 and would have no effect on R2.

 

HTH

 

Rick

HTH

Rick

I  am sorry for misunderstanding, I am confusing everything.

Let me describe scenario in more details:

R3 and R2 are iBGP neighbors. R1 and R2, R1 and R3 are iBGP neighbors as well.

R3 is receiving 8.8.8.0/24 NLRI. I am applying abovementioned route-map on it: neighbor <ISP 1> route-map abc IN. and I expect that only R1 gets this filter, but what about R2 ? Why shouldn't R2 get this filter. Even if R2 is connected directly to R3 through separate interface, R2 would get it, however in this case it would be possible to use another route-map "SET" interface clause by pointing R1 facing interface. 

Please, correct me if I am wrong. 

 

Hello

All you internal ibgp routers will be affected if you apply filtering/local preference on prefixes advertised from either ISP.


For instance if you dont have any neighbor filtering on either ebgp/ibgp rtr 1-3  then you would see dual routes in the bgp tables of all ibgp routers for that ISP advertised network,However only one of those two prefixes would be selected to be entered into the local route tables probably if all things are equal in the bgp selection process it would be selected based on the oldest entry of the two prefixes but it could be another path attribute further up the bgp selection process that affects

route selection.

 

Now if you apply neighbor prefix-list / filtering or route-map then this filter would negate that ebgp prefix and that would also affect the other ibgp rtrs which would also remove the filtered prefix.

 

The same logic apply's to say a appending a local-preference via a neighbor route-map statement on the same isps advertised ebgp prefix, the least preferred prefix would be removed from the bgp table and only the preferred prefix would then be entered in the route table on the ibgp routers.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Richard Burts
Hall of Fame
Hall of Fame

In my previous responses I was assuming that you were asking about applying filters on R1 (based mostly on the explanation in the original post that " if R1 is peered with R3 and R2 across the same subnet?" which seems for focus on R1. But as the discussion has progressed I think that you are really focusing on R3 and applying filters on R3.

 

In looking at the original post you asked this question "Will it work properly if R1 is peered with R3 and R2 across the same subnet?". My answer is that if a filter is properly applied to a neighbor that it does not make any difference whether the neighbor peering is in the same subnet or is in different subnets. 

 

You also asked "What if I would filter on R3 some received network(e.g. 8.8.8.0/24) with higher local-pref and send it only to R1. Will R2 get this filtration policy as well?". I am not quite clear what you are really asking but in general what you filter and send from R3 to R1 does not impact what you might filter or send to R2. Another way of looking at this question is to observe that if you want R3 to advertise 8.8.8.0 to R1 and not to R2 is that you would apply the filter on R3 for neighbor R2 and not for neighbor R1. 

 

Another aspect that makes this discussion a bit confusing is that in your example the route map is setting local preference. When you are setting local preference the route map would be applied inbound to whichever neighbor was advertising the route, and in your example that would seem to be ISP1. So that route map does not have any impact on which prefixes you would advertise to either R1 or R2.

 

HTH

 

Rick

HTH

Rick