How to Configure BGP Local Preference Attribute

thanks for clarifying Laz

1 Like

Hi Rene,Laz,

I have a question about next-hop-self command.
Why you did not added it in the configuration on R4?
Because R4 is not facing AS1(R1)?
BR
Carlos

Hello Carlos

The next-hop-self command is implemented on iBGP routers that also have an eBGP connection. Whenever such a router advertises a network from another AS into its local AS, BGP advertises the neighboring eBGP router’s IP address as the next hop. However, the other routers in the local AS don’t know how to route to that next hop address. So by issuing the next-hop-self command, the router is telling its iBGP neighbors to send any traffic to the specific prefix to itself.

So you are correct, the reason the command was not issued is that R4 has no eBGP peering with any router in AS1.

You can find out more about the next-hop-self command at the following lesson:

I hope this has been helpful!

Laz

1 Like

5 starts as usual,Many thanks Laz
Regards from Praha

1 Like

lets say i conbfigured teh Local preference as OUT towards my EBGP neighbor . In that case ,will this local preference value will impact the neighbors routing policy based my advertised/configured local preference value.??

one thing is that, The highest router id is 2.2.2.2 or 3.3.3.3 ??.

R4#show ip bgp
BGP table version is 2, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
 i1.1.1.0/24       3.3.3.3                  0    100      0 1 i
>i                 2.2.2.2                  0    100      0 1 i

Hello Narad

If you want to modify the local preference using a route map, and you apply it in an outbound direction on an eBGP neighbor, then it is the neighbor’s AS that is affected by this. The local preference in the local router remains unchanged.

If all compard BGP attributes remain the same, then thee very last tie breaker that is used is the lowest BGP neighbor IP address. In the lesson, as well as in your sample BGP table in your post, you can see that the BGP neighbor with an address of 2.2.2.2 (which is the lower address) is chosen.

You can find out more about the way BGP attributes are chosen, as well as this very last tie breaker, in the following lesson:

I hope this has been helpful!

Laz

Hi Rene,

Just a quick question regarding your configuration on router R2 and R3.

Why do you need to add the neighbor 3.3.3.3 command statement on R2 and neighbor 2.2.2.2 command statement on R3 even though they’re not directly connected? cause based on your topology, they’re only directly connected to R4.

Hello Joed

Keep in mind that within an AS, iBGP peerings must be configured as a full mesh. This means that all BGP routers within the AS must be peers with all other BGP routers in the AS. iBGP peerings do not need to be directly connected. For more information take a look at these NetworkLessons notes:

I hope this has been helpful!

Laz

1 Like

You might be missing the Loopback interface on your router configs. Or is this not needed?

1 Like

Hello Alex

It seems that all routers have a loopback interface configured except for R1. The loopback has been configured within the lesson itself. However, R1 is indeed missing the configuration of the loopback, and that is necessary. I’ll let Rene know to make the change…

Thanks for pointing that out!

Laz

1 Like

Thanks @acastillo890 . The loopback interface should be there. I added it in the configs.

Rene

Good day all,

I had a question,

OSPF and BGP have the Same redundant routes to the same destination, but

Why is eBGP route still the best route over my OSPF routes when OSPF was redistributed into BGP with a higher Local pref of 200?

AD is not changed, and all other bgp attributes are still default.

I appreciate any insight on this, I am trying to understand why this is happening as I am having trouble finding documentation on explaining this behavior.

Hello Steven

Regardless of how routes have been redistributed and regardless of the attributes that may be defined within BGP, or the metrics that have been adjusted in OSPF, the first thing that is always examined to determine if a particular route will enter the routing table is the administrative distance (AD). Since the ADs have not been changed, then regardless of all other configurations, eBGP’s route will enter the routing table simply because the AD is 20 while OSPF’s AD is 110.

More info can be found at this NetworkLessons note on the Administrative Distance.

I hope this has been helpful!

Laz

1 Like

Thank you for the information. This was helpful.

1 Like