cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2075
Views
0
Helpful
2
Replies

BGP route-map and prefix list

bapatsubodh
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

John Blakley
VIP Alumni
VIP Alumni

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

HTH, John *** Please rate all useful posts ***

View solution in original post

2 Replies 2

John Blakley
VIP Alumni
VIP Alumni

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

HTH, John *** Please rate all useful posts ***

Thanks. IT was key-word "prefix-list" that was msising.

Review Cisco Networking for a $25 gift card