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

BGP Local-pref

mohammedrafiq
Level 1
Level 1

Hi,

I am trying to change the local prefrence of my prefix 142.25.12.0/24 advertising to my ISP AS100 to 150.when I check on my router it showing me LF150 on default route which I am recieving from ISP, instead of on my prefix ,is this is correct or my config below is incorrect?router bgp 200

no synchronization

bgp log-neighbor-changes

network 142.25.12.0 mask 255.255.255.0

neighbor 98.20.130.84 remote-as 100

neighbor 98.20.130.84 route-map LOCAL_PREF in

no auto-summary

!

ip classless

ip route 142.25.12.0 255.255.255.0 Null0

ip http server

!

ip as-path access-list 10 permit ^$

!

ip access-list standard PREF

permit 142.25.12.0 0.0.0.255

!

route-map LOCAL_PREF permit 10

match ip address name PREF

set local-preference 150

!

route-map LOCAL_PREF permit 20

!

!

3750#sh ip bgp

BGP table version is 3, local router ID is 172.16.1.1

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

*> 0.0.0.0 98.20.130.84 0 150 0 100 i

*> 142.25.12.0/24 0.0.0.0 0 32768 i

Regards

5 Replies 5

Richard Burts
Hall of Fame
Hall of Fame

Mohammed

The IOS is doing exactly what you have asked it to do: it is assigning local pref of 150 to routes received from that neighbor. Note that the route map which is assigning local pref is assigned as "in" which is routes that you receive from the neighbor. An "out" route map would control what you advertise TO the neighbor.

Unfortunately you can not do what you apparently want to do: you can not set the local preference on routes that you advertise to your external neighbor. Local preference is used in deciding which routes that you have learned are the routes that you will prefer to use. Local pref is set by the router that is receiving the routes and can not be set on routes that you are sending to an external neighbor.

HTH

Rick

HTH

Rick

Hi Rick,

is this mean, if I advertise the same prefix to my 2nd ISP with LF of 100, then outbound traffic will be taking the path through my 1st ISP with LF150?

Regards,

Mohammed

When you say LF is that supposed to be local preference?

Perhaps you did not understand my first post: you do not advertise local preference to external peers.

Let me try to explain it slightly differently: Local preference is assigned by you to routes that you learn from neighbors. Local preference will help to control how you send outbound traffic.

What you advertise to external neighbors will control how traffic is sent to you (your inbound traffic). The neighbor may assign local preference to your routes, but they do the assignment and you do not advertise local preference to them.

So remember this: routes that you learn from a neighbor will control how you send outbound traffic. Routes that you advertise to an neighbor will help to control inbound traffic.

HTH

Rick

HTH

Rick

Thanks Rick,

it clear as crystal now!!!!!!!

Mohammed

I am glad that my explanation was helpful. The forum is a very useful place to ask questions and to clarify concepts. I encourage you to continue your participation in the forum.

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card