Why my route-map did not set local-preference=200?

Answered Question
Mar 16th, 2009
User Badges:

Hey, can you help me understand this:

I setup a route-map to set local-preference to 200 if route is coming from 10.0.0.0/24 (ISP1), so I would make routes from ISP1 the preferred ones.


However, I see that my 'show ip bgp' lists only local-preference=100.

Why no routes were set to '200'?

Here is the the output from RouterB, the one I set the access-list 1 and route-map. Detailed diagram with run config is attached. Thanks in advance!!


RouterB#show ip bgp

BGP table version is 48, local router ID is 2.2.2.2

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.1/32 192.168.1.1 0 100 0 1803 i

*> 2.2.2.2/32 0.0.0.0 0 32768 i

*>i3.3.3.3/32 192.1.1.3 0 100 0 i

*> 10.0.0.0/24 0.0.0.0 0 32768 i

* i192.1.1.0 192.1.1.3 0 100 0 i

*> 0.0.0.0 0 32768 i

*>i192.168.1.0 192.1.1.3 0 100 0 i

RouterB#show ip access-lists

Standard IP access list 1

10 permit 10.0.0.0, wildcard bits 0.0.0.255

RouterB#





Correct Answer by Edison Ortiz about 8 years 2 months ago

As you noted, match ip route-source isn't supported as inbound policy under BGP.


This command is used for redistributing from one routing protocol to another:

http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_pi1.html#wp1014124


If you want to increase the local-preference on routes coming from the 10.0.0.1 BGP peer, you simply create a route-map with local-pref 200 - apply this route-map under BGP inbound. For instance:



route-map LOCAL-PREF permit 10

set local-preference 200


router bgp 2000

no neighbor 1.1.1.1 remote-as 1803

neighbor 10.0.0.1 remote-as 1803 route-map LOCAL-PREF in



Then on the CLI, clear ip bgp * in


HTH,


__


Edison.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
sunilferrao Mon, 03/16/2009 - 22:28
User Badges:

Hi ,


Try this

apply route-map SELECT_ISP out to ibgp peer

and do clear ip bgp soft *



news2010a Mon, 03/16/2009 - 22:53
User Badges:

Can you clarify how exactly I would apply the route-map out to ibgp peer?


Do you mean that I could do:

access-list 1 permit ?

sunilferrao Tue, 03/17/2009 - 00:05
User Badges:

under bgp 2000

neighbor 192.1.1.3 route-map SELECT_ISP out


rpfinneran Tue, 03/17/2009 - 03:35
User Badges:
  • Bronze, 100 points or more

I am guessing that you are matching ip address in your route map, then setting Local Pref.


That isn't what you are trying to do. What you should do is match ip route-source to ACL1. Then set local preference.


Paste your route map and BGP configs here and will resolve.

rpfinneran Tue, 03/17/2009 - 03:47
User Badges:
  • Bronze, 100 points or more

Yup, just realize you attached your configs. So, make the following changes on RouterB...


conf t

route-map SELECT_ISP 10

no match ip address 1

match ip route-source 1

exit

router bgp 2000

neighbor 10.0.0.1 route-map SELECT_ISP in

end

wr

news2010a Tue, 03/17/2009 - 06:16
User Badges:

I did as your advised. However, I got the message below between the "%" mark. Any ideas what's wrong?


RouterB(config)#route-map SELECT_ISP 10

RouterB(config-route-map)#no match ip address 1

RouterB(config-route-map)#match ip route-source 1

RouterB(config-route-map)#exit

RouterB(config)#router bgp 2000

RouterB(config-router)#neig 10.0.0.1 route-map SELECT_ISP in

% "SELECT_ISP" used as BGP inbound route-map, route source match not supported

RouterB(config-router)#

RouterB#show route-map

route-map SELECT_ISP, permit, sequence 10

Match clauses:

ip route-source (access-lists): 1

Set clauses:

Policy routing matches: 0 packets, 0 bytes

RouterB#



Correct Answer
Edison Ortiz Tue, 03/17/2009 - 07:07
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

As you noted, match ip route-source isn't supported as inbound policy under BGP.


This command is used for redistributing from one routing protocol to another:

http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_pi1.html#wp1014124


If you want to increase the local-preference on routes coming from the 10.0.0.1 BGP peer, you simply create a route-map with local-pref 200 - apply this route-map under BGP inbound. For instance:



route-map LOCAL-PREF permit 10

set local-preference 200


router bgp 2000

no neighbor 1.1.1.1 remote-as 1803

neighbor 10.0.0.1 remote-as 1803 route-map LOCAL-PREF in



Then on the CLI, clear ip bgp * in


HTH,


__


Edison.

Harold Ritter Tue, 03/17/2009 - 06:16
User Badges:
  • Cisco Employee,

I would also recommend removing the BGP session to 1.1.1.1, as you already have a session to routerA (10.0.0.1).


Regards

news2010a Tue, 03/17/2009 - 11:15
User Badges:

Thanks. Regarding removing the session to the loopback0 (1.1.1.1), isn't the best practice establish session to loopback addresses for stability reasons? How do you handle it in this case? I am not sure if I could remove the session for the physical IPs and leave only the ones for the loopback in this case...

Actions

This Discussion