06-27-2012 08:09 AM - edited 03-04-2019 04:49 PM
Hi,
Trying to set local preference using the following configuration:
R2#
R2#term len 0
R2#sh runn
R2#sh running-config
Building configuration...
Current configuration : 1000 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
no aaa new-model
resource policy
memory-size iomem 5
ip cef
no ip domain lookup
interface FastEthernet0/0
ip address 10.1.1.2 255.255.255.0
duplex auto
speed auto
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
router bgp 200
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 10.1.1.1 remote-as 100
neighbor 10.1.1.1 soft-reconfiguration inbound
neighbor 10.1.1.1 route-map apple in
no auto-summary
no ip http server
no ip http secure-server
ip prefix-list hp seq 5 permit 192.168.1.0/24 ------------------------------------- matches only one prefix
route-map apple permit 10 ------------------------------------------------------------- only one match statement in route-map.
match ip address hp
set local-preference 200 --------------------------------------------------------------------- set local pref to 200
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
R2#
R2#
R2#show ip bgp
BGP table version is 3, 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
*> 192.168.1.0 10.1.1.1 0 200 0 100 i ----------------------------------------------------------------- local pref set to 200 as expected.
*> 192.168.2.0 10.1.1.1 0 200 0 100 i ----------------------------------------------------------------- local pref set to 200 why?
R2#sh ip rou
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
B 192.168.1.0/24 [20/0] via 10.1.1.1, 00:05:40
B 192.168.2.0/24 [20/0] via 10.1.1.1, 00:05:40
R2#
R2#
How come the second pre-fix is appearing in the BGP table it should not appear as by default route-map should block this?
Please share the experience.
Thanks!
Subodh
Solved! Go to Solution.
06-27-2012 08:14 AM
Subodh,
It looks like you're matching on an hp access list in your route map. Try changing this to your prefix list name:
route-map apple permit 10
match ip address prefix-list hp
set local-preference 200
Clear your bgp sessions and you should see the correct local-pref.
HTH,
John
06-27-2012 08:14 AM
Subodh,
It looks like you're matching on an hp access list in your route map. Try changing this to your prefix list name:
route-map apple permit 10
match ip address prefix-list hp
set local-preference 200
Clear your bgp sessions and you should see the correct local-pref.
HTH,
John
06-27-2012 08:19 AM
Thanks. IT was key-word "prefix-list" that was msising.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide