Sign in to follow this  
Followers 0
talent pk

BGP Local-Preference_Vs_Specific Mask

6 posts in this topic

BGP path selection

 

1.First compare highest Weight

2.If weight equals then compare Highest Local _ Preference

 

Suppose a multi-homed Autonomous System AS 100 receives a Summary Route 172.16.0.0/21 but with a Local Pref of 120

And the other router sends in all the same routes from the same source but with specific prefix masks which are 172.16.0.0 to 172.16.7.0 however this router sends in with a BGP Local _ Preference of 100

 

So now Autonomous system 100 receives a Summary Address with local preference of 120 and more specific routes with local _ preference of 100

 

Now both routes will be installed into the routing table

but which next hop router will end up forwarding packets

 

1. The one with Highest local pref

2. the one with most specific prefix mask

Edited by talent pk
0

Share this post


Link to post
Share on other sites

the answer is again the router which is sending in the more specific routes will forward the packets even though it has lower Local_preference.

Local preference is the way of election process to install the route into routing table but if the routes comes in with different Prefix notations such as a summary and a more specific then both routes will be installed separately into the routing table.

the router packet forward decision comes in later process. at this time the router matches the destination with longer prefix and forwards the packet.

0

Share this post


Link to post
Share on other sites

FYI i saw this question creating confusing in many people's mind as i was exploring some forums. so i never mind posted it in here.

 

here is Topology with configs if any one wants to practice

 

image.jpg

gif upload

 

 

 

R4#show running-config

Building configuration...

 

Current configuration : 2355 bytes

!

version 12.4

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname R4

!

boot-start-marker

boot-end-marker

!

!

no aaa new-model

!

resource policy

!

ip subnet-zero

!

!

ip cef

no ip domain lookup

 

interface Loopback0

ip address 172.16.2.1 255.255.255.0

!

interface Loopback1

ip address 172.16.0.1 255.255.255.0

!

interface Loopback2

ip address 172.16.1.1 255.255.255.0

!

interface Loopback3

ip address 172.16.3.1 255.255.255.0

!

interface Loopback4

ip address 172.16.4.1 255.255.255.0

!

interface Loopback5

ip address 172.16.5.1 255.255.255.0

!

interface Loopback6

ip address 172.16.6.1 255.255.255.0

!

interface Loopback7

ip address 172.16.7.1 255.255.255.0

!

interface FastEthernet0/0

no ip address

shutdown

duplex half

!

interface Serial1/0

ip address 192.168.1.1 255.255.255.252

serial restart-delay 0

!

interface Serial1/1

ip address 192.168.1.5 255.255.255.252

serial restart-delay 0

!

 

 

 

!

router bgp 50

no synchronization

bgp log-neighbor-changes

aggregate-address 172.16.0.0 255.255.248.0

redistribute connected metric 20 route-map FILTER

neighbor 192.168.1.2 remote-as 100

neighbor 192.168.1.2 distribute-list 112 out

neighbor 192.168.1.6 remote-as 100

neighbor 192.168.1.6 distribute-list 111 out

no auto-summary

!

ip classless

ip route 0.0.0.0 0.0.0.0 Serial1/0

ip route 0.0.0.0 0.0.0.0 Serial1/1

!

no ip http server

no ip http secure-server

!

!

access-list 10 permit 192.168.1.0 0.0.0.255

access-list 111 deny ip host 172.16.0.0 host 255.255.248.0

access-list 111 permit ip any any

access-list 112 permit ip host 172.16.0.0 host 255.255.248.0

!

route-map FILTER deny 10

match ip address 10

!

route-map FILTER permit 20

!

===========================================================================

 

hostname R1

!

 

!

 

interface FastEthernet0/0

no ip address

shutdown

duplex half

!

interface Serial1/0

ip address 192.168.1.2 255.255.255.252

serial restart-delay 0

!

 

!

 

!

interface Ethernet2/0

ip address 192.168.2.1 255.255.255.0

duplex half

!

 

 

!

router bgp 100

no synchronization

bgp log-neighbor-changes

neighbor 192.168.1.1 remote-as 50

neighbor 192.168.2.2 remote-as 100

neighbor 192.168.2.2 next-hop-self

neighbor 192.168.2.2 route-map LOCAL-PREF out

no auto-summary

!

ip classless

!

no ip http server

no ip http secure-server

!

!

!

route-map LOCAL-PREF permit 10

set local-preference 120

!

=========================================

 

R2

 

Current configuration : 1987 bytes

!

version 12.4

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname R2

!

boot-start-marker

boot-end-marker

!

 

interface FastEthernet0/0

no ip address

shutdown

duplex half

!

interface Serial1/0

ip address 192.168.1.6 255.255.255.252

serial restart-delay 0

!

interface Serial1/1

no ip address

shutdown

serial restart-delay 0

 

no ip address

shutdown

serial restart-delay 0

!

interface Ethernet2/0

ip address 192.168.3.1 255.255.255.0

duplex half

!

 

!

router bgp 100

no synchronization

bgp log-neighbor-changes

neighbor 192.168.1.5 remote-as 50

neighbor 192.168.3.2 remote-as 100

neighbor 192.168.3.2 next-hop-self

neighbor 192.168.3.2 route-map LOCAL-PREF2 out

no auto-summary

!

ip classless

!

no ip http server

no ip http secure-server

!

!

!

route-map LOCAL-PREF2 permit 10

set local-preference 100

!

!

!

!

control-plane

!

!

!

!

!

!

gatekeeper

shutdown

!

!

 

================================================

R3

 

interface FastEthernet0/0

no ip address

shutdown

duplex half

!

interface Ethernet1/0

ip address 192.168.2.2 255.255.255.0

duplex half

!

interface Ethernet1/1

ip address 192.168.3.2 255.255.255.0

duplex half

!

interface Ethernet1/2

no ip address

shutdown

duplex half

!

interface Ethernet1/3

no ip address

shutdown

duplex half

!

interface Ethernet1/4

no ip address

shutdown

duplex half

!

interface Ethernet1/5

no ip address

shutdown

duplex half

!

interface Ethernet1/6

no ip address

shutdown

duplex half

!

interface Ethernet1/7

no ip address

shutdown

duplex half

!

router bgp 100

no synchronization

bgp log-neighbor-changes

neighbor 192.168.2.1 remote-as 100

neighbor 192.168.3.1 remote-as 100

no auto-summary

!

ip classless

!

no ip http server

no ip http secure-server

!

 

 

end

 

 

ON Backbone

==============

 

 

image.jpg

free image hosting

 

BackBone#

Edited by talent pk
0

Share this post


Link to post
Share on other sites

they are chosen as best paths to be installed into routing table but only the routes with longer prefix will forward the packet even its Local Preference is low

0

Share this post


Link to post
Share on other sites

Hello,

 

It's always more specific network. You don't even need to look into BGP parameters, AD or metric, Longest Prefix >> Everything Else when it comes to route selection. (I tend to forget this absolute vital fact from time to time, too :-) )

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0