Weird BGP problem/question on BGP path selection

From: Jeff Lodwick (climberartist@xxxxxxxxxxx)
Date: Fri Nov 09 2001 - 20:02:31 GMT-3


   
Hi group,
I am having a problem with how BGP's path selection is working on this lab
setup I have. First let me tell you what I have then I'll show the configs
at the bottom. I have 6 routers that all are running OSPF and no
virtual-link problems so that I have simple routes to all subnets. The only
interfaces that aren't in OSPF are 2 loopback interfaces off r4 (10.1.1.0
and 10.2.2.0) which I have redistributed into BGP (redistribute connected)
and advertised through BGP. I have communities sending med's to r4 so that
r4 selects certain routes to get to 2 different subnets off r1 and it is
working great. On r1, r2 and r5 I set up 2 different confederations (65000
on r5 and 65001 on r1 and r2). R2 has a neighbor to r3 in AS 300 and r5 has
a neighbor to r6 in AS 600. R3 and r6 both have a neighbor to r4 in AS 400.
  With this setup r1 obviously picks the route through r2 since it sees 2
AS's through r2 (300 400) and 3 AS's through r5 (65000 600 400) so I set an
AS-path prepend on r4 so that r1 sees both r2 and r5 with 3 AS's to pass
through and should use the next determination in BGP's path selection
(origin then MED then closest IGP neighbor then BGP router ID). The
origin's are both incomplete since they are both redistributed into BGP so
the next path selection should be the MED. To test this I put a route-map
on r1 setting metrics to incoming routes from r2 and r5. I set it up so
that the subnet of 10.1.1.0 has a metric of 10 when coming from r2 and any
other routes coming from r2 are set with a metric of 20. I did the same
thing on r5 with the subnet of 10.2.2.0 having a metric of 10 and all other
routes a metric of 20. I took off the second statement off of both route
maps setting the metric of all other routes to 20 and it works fine. Routes
to 10.1.1.1 go through r2 and routes to 10.2.2.2 go through r5 but right
when I add those route maps back specifying all other traffic to a metric of
20 all of the routes on r1 learned through BGP go through r2 then are
withdrawn and then all routes learned through BGP go through r5. Below are
my configs. I also included debug ip bgp updates on r1 and did a sh ip bgp
twice to show where it adds all routes to r2 then withdraws all the routes
and adds them with the next hop to r5. Please help me as my head is
starting to hurt from repeatedly banging it on the keyboard and getting to
the point to where I'm about ready to throw my computer out the window. :)
Below are the configs and debug from r1.

>>>>>Thanks in advance,
Jeff Lodwick The countdown to D-day begins. 18 days left (Nov. 28)

r1#sh run
Building configuration...

Current configuration : 2373 bytes
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r1
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ip address 137.20.1.33 255.255.255.240
!
interface Loopback1
ip address 137.20.1.17 255.255.255.240
!
interface Loopback2
ip address 1.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Serial0
no ip address
shutdown
!
interface Serial0.1
ip ospf network point-to-multipoint
!
interface Serial0.2
ip ospf network point-to-multipoint
!
interface Serial1
no ip address
shutdown
!
interface Serial2
no ip address
encapsulation frame-relay
no ip route-cache
no ip mroute-cache
clockrate 1000000
!
interface Serial2.1 point-to-point
ip address 137.20.100.2 255.255.255.0
no ip route-cache
ip ospf network point-to-point
no ip mroute-cache
frame-relay interface-dlci 102
!
interface Serial2.2 point-to-point
ip address 137.20.101.1 255.255.255.0
no ip route-cache
ip ospf network point-to-point
no ip mroute-cache
frame-relay interface-dlci 105
!
interface Serial3
no ip address
shutdown
!
interface Serial4
no ip address
shutdown
!
interface Serial5
no ip address
shutdown
!
interface FastEthernet0
no ip address
shutdown
half-duplex
!
router ospf 100
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 137.20.100.2 0.0.0.0 area 0
network 137.20.101.1 0.0.0.0 area 0
!
router bgp 65001
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 100
bgp confederation peers 65000
neighbor 2.2.2.2 remote-as 65001
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 update-source Loopback2
neighbor 2.2.2.2 route-map medr2 in
neighbor 5.5.5.5 remote-as 65000
neighbor 5.5.5.5 ebgp-multihop 255
neighbor 5.5.5.5 update-source Loopback2
neighbor 5.5.5.5 route-map medr5 in
no auto-summary
!
ip classless
no ip http server
!
access-list 5 permit 10.1.1.0 0.0.0.255
access-list 6 permit 10.2.2.0 0.0.0.255
route-map medr5 permit 10
match ip address 6
set metric 10
!
route-map medr5 permit 20
set metric 20
!
route-map medr2 permit 10
match ip address 5
set metric 10
!
route-map medr2 permit 20
set metric 20
!
!
alias exec ip sh ip route
alias exec int sh ip int brief
alias exec ipx sh ipx route
alias exec xint sh ipx int brief
!
line con 0
line aux 0
line vty 0 4
login
!
end

r2#sh run
Building configuration...

Current configuration : 1793 bytes
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r2
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
encapsulation frame-relay
no fair-queue
clockrate 1000000
!
interface Serial0.1 point-to-point
ip address 137.20.32.2 255.255.255.0
ip ospf network point-to-point
frame-relay interface-dlci 203
!
interface Serial0.2 point-to-point
ip address 137.20.100.1 255.255.255.0
ip ospf network point-to-point
frame-relay interface-dlci 201
!
interface Serial1
no ip address
shutdown
!
interface BRI0
no ip address
shutdown
!
router ospf 100
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 137.20.32.2 0.0.0.0 area 1
network 137.20.100.1 0.0.0.0 area 0
!
router bgp 65001
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 100
bgp confederation peers 65000
neighbor 1.1.1.1 remote-as 65001
neighbor 1.1.1.1 ebgp-multihop 255
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 137.20.32.3 remote-as 300
neighbor 137.20.32.3 send-community
neighbor 137.20.32.3 route-map comm out
no auto-summary
!
ip classless
ip http server
ip bgp-community new-format
!
access-list 1 permit 137.20.100.0 0.0.0.255
access-list 2 permit 137.20.101.0 0.0.0.255
route-map comm permit 10
match ip address 1
set community 100:200
!
route-map comm permit 20
match ip address 2
set community 100:100
!
!
alias exec ip sh ip route
alias exec int sh ip int brief
alias exec ipx sh ipx route
alias exec xint sh ipx int brief
!
line con 0
line aux 0
line vty 0 4
login
!
end

r3#sh run
Building configuration...

Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r3
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
!
interface Loopback0
ip address 137.20.3.33 255.255.255.224
no ip directed-broadcast
!
interface Loopback1
ip address 137.20.3.65 255.255.255.224
no ip directed-broadcast
!
interface Serial0
ip address 137.20.32.3 255.255.255.0
no ip directed-broadcast
encapsulation frame-relay
ip ospf network point-to-point
no ip mroute-cache
no fair-queue
clockrate 1000000
frame-relay interface-dlci 302
!
interface Serial1
ip address 137.20.103.1 255.255.255.0
no ip directed-broadcast
!
interface TokenRing0
no ip address
no ip directed-broadcast
shutdown
!
router ospf 100
network 137.20.32.3 0.0.0.0 area 1
network 137.20.103.1 0.0.0.0 area 1
!
router bgp 300
no synchronization
neighbor 137.20.32.2 remote-as 100
neighbor 137.20.103.2 remote-as 400
neighbor 137.20.103.2 route-map med out
no auto-summary
!
ip classless
ip bgp-community new-format
ip community-list 1 permit 100:200
ip community-list 2 permit 100:100
!
route-map med permit 10
match community 1
set metric 10
!
route-map med permit 20
match community 2
set metric 20
!
route-map med permit 30
!
!
alias exec ip sh ip route
alias exec int sh ip int brief
alias exec ipx sh ipx route
alias exec xint sh ipx int brief
!
line con 0
transport input none
line aux 0
line vty 0 4
login
!
end

r4#sh run
Building configuration...

Current configuration : 1216 bytes
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r4
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Loopback1
ip address 10.2.2.2 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 137.20.103.2 255.255.255.0
clockrate 1000000
!
interface Serial1
ip address 137.5.0.4 255.255.255.0
clockrate 1000000
!
interface BRI0
no ip address
shutdown
!
router ospf 100
log-adjacency-changes
network 137.5.0.4 0.0.0.0 area 1
network 137.20.103.2 0.0.0.0 area 1
!
router bgp 400
no synchronization
bgp always-compare-med
bgp log-neighbor-changes
network 10.1.1.0 mask 255.255.255.0
network 10.2.2.0 mask 255.255.255.0
redistribute connected
neighbor 137.5.0.6 remote-as 600
neighbor 137.20.103.1 remote-as 300
neighbor 137.20.103.1 route-map prepend out
no auto-summary
!
ip classless
ip http server
!
route-map prepend permit 10
set as-path prepend 400
!
!
alias exec ip sh ip route
alias exec int sh ip int brief
alias exec ipx sh ipx route
alias exec xint sh ipx int brief
!
line con 0
line aux 0
line vty 0 4
!
end

r5#sh run
Building configuration...

Current configuration : 1624 bytes
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r5
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0
ip address 137.20.50.1 255.255.255.0
!
interface Serial0
ip address 137.20.101.5 255.255.255.0
encapsulation frame-relay
ip ospf network point-to-point
clockrate 1000000
frame-relay map ip 137.20.101.1 501 broadcast
frame-relay map ip 137.20.101.3 501 broadcast
!
interface Serial1
no ip address
shutdown
!
router ospf 100
log-adjacency-changes
network 5.5.5.5 0.0.0.0 area 0
network 137.20.50.1 0.0.0.0 area 1
network 137.20.101.5 0.0.0.0 area 0
!
router bgp 65000
no synchronization
bgp log-neighbor-changes
bgp confederation identifier 100
bgp confederation peers 65001
neighbor 1.1.1.1 remote-as 65001
neighbor 1.1.1.1 ebgp-multihop 255
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 137.20.50.6 remote-as 600
neighbor 137.20.50.6 send-community
neighbor 137.20.50.6 route-map comm out
no auto-summary
!
ip classless
ip http server
ip bgp-community new-format
!
access-list 1 permit 137.20.100.0 0.0.0.255
access-list 2 permit 137.20.101.0 0.0.0.255
route-map comm permit 10
match ip address 1
set community 100:100
!
route-map comm permit 20
match ip address 2
set community 100:200
!
!
alias exec ip sh ip route
alias exec int sh ip int brief
alias exec ipx sh ipx route
alias exec xint sh ipx int brief
!
line con 0
line 1 16
line aux 0
line vty 0 4
login
!
end

r6#sh run
Building configuration...

Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r6
!
!
!
!
!
!
network-clock base-rate 56k
ip subnet-zero
no ip domain-lookup
!
!
!
!
!
!
!
!
!
!
interface Ethernet0
ip address 137.20.50.6 255.255.255.0
!
interface Serial0
no ip address
shutdown
no fair-queue
!
interface Serial1
ip address 137.5.0.6 255.255.255.0
!
router ospf 100
network 137.5.0.6 0.0.0.0 area 1
network 137.20.50.6 0.0.0.0 area 1
!
router bgp 600
no synchronization
neighbor 137.5.0.4 remote-as 400
neighbor 137.5.0.4 route-map med out
neighbor 137.20.50.1 remote-as 100
no auto-summary
!
no ip http server
ip classless
ip bgp-community new-format
ip community-list 1 permit 100:200
ip community-list 2 permit 100:100
!
route-map med permit 10
match community 1
set metric 10
!
route-map med permit 20
match community 2
set metric 20
!
route-map med permit 30
!
!
voice-port 1/4
!
voice-port 1/6
!
alias exec ip sh ip route
alias exec int sh ip int brief
alias exec ipx sh ipx route
alias exec xint sh ipx int brief
!
line con 0
transport input none
line aux 0
line 2 3
line vty 0 4
!
end

r1#debug ip bgp update
BGP updates debugging is on
r1#clear ip bgp *
r1#
04:20:24: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down User reset
04:20:24: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Down User reset
04:20:53: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
04:20:53: BGP(0): 2.2.2.2 computing updates, afi 0, neighbor version 0,
table version 1, starting at 0.0.0.0
04:20:53: BGP(0): 2.2.2.2 update run completed, afi 0, ran for 0ms, neighbor
version 0, start version 1, throttled to 1
04:20:53: BGP: 2.2.2.2 initial update completed
04:20:53: BGP(0): 2.2.2.2 rcvd UPDATE w/ attr: nexthop 2.2.2.2, origin i,
localpref 100, path 300 400 400
04:20:53: BGP(0): 2.2.2.2 rcvd 10.1.1.0/24
04:20:53: BGP(0): 2.2.2.2 rcvd 10.2.2.0/24
04:20:53: BGP(0): 2.2.2.2 rcvd UPDATE w/ attr: nexthop 2.2.2.2, origin ?,
localpref 100, path 300 400 400
04:20:53: BGP(0): 2.2.2.2 rcvd 137.5.0.0/24
04:20:53: BGP(0): 2.2.2.2 rcvd 137.20.103.0/24
04:20:53: BGP(0): Revise route installing 10.1.1.0/24 -> 2.2.2.2 to main IP
table
04:20:53: BGP(0): Revise route installing 10.2.2.0/24 -> 2.2.2.2 to main IP
table
04:20:53: BGP(0): Revise route installing 137.5.0.0/24 -> 2.2.2.2 to main IP
table
04:20:53: BGP(0): Revise route installing 137.20.103.0/24 -> 2.2.2.2 to main
IP tablesh ip bgp
04:20:58: BGP(0): 2.2.2.2 computing updates, afi 0, neighbor version 1,
table version 5, starting at 0.0.0.0
04:20:58: BGP(0): 2.2.2.2 update run completed, afi 0, ran for 0ms, neighbor
version 1, start version 5, throttled to 5
BGP table version is 5, local router ID is 137.20.1.33
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network Next Hop Metric LocPrf Weight Path
*>i10.1.1.0/24 2.2.2.2 10 100 0 300 400 400 i
*>i10.2.2.0/24 2.2.2.2 20 100 0 300 400 400 i
*>i137.5.0.0/24 2.2.2.2 20 100 0 300 400 400 ?
*>i137.20.103.0/24 2.2.2.2 20 100 0 300 400 400 ?
r1#
04:21:09: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Up
04:21:09: BGP(0): 5.5.5.5 computing updates, afi 0, neighbor version 0,
table version 5, starting at 0.0.0.0
04:21:09: BGP(0): 5.5.5.5 NEXT_HOP part 1 net 10.1.1.0/24, next 2.2.2.2
04:21:09: BGP(0): 5.5.5.5 send UPDATE (format) 10.1.1.0/24, next 2.2.2.2,
metric 10, path 300 400 400
04:21:09: BGP(0): 5.5.5.5 NEXT_HOP part 1 net 10.2.2.0/24, next 2.2.2.2
04:21:09: BGP(0): 5.5.5.5 send UPDATE (format) 10.2.2.0/24, next 2.2.2.2,
metric 20, path 300 400 400
04:21:09: BGP(0): 5.5.5.5 NEXT_HOP part 1 net 137.5.0.0/24, next 2.2.2.2
04:21:09: BGP(0): 5.5.5.5 send UPDATE (format) 137.5.0.0/24, next 2.2.2.2,
metric 20, path 300 400 400
04:21:09: BGP(0): 5.5.5.5 NEXT_HOP part 1 net 137.20.103.0/24, next 2.2.2.2
04:21:09: BGP(0): 5.5.5.5 send UPDATE (format) 137.20.103.0/24, next
2.2.2.2, metric 20, path 300 400 400
04:21:09: BGP(0): 5.5.5.5 4 updates enqueued (average=67, maximum=67)
04:21:09: BGP(0): 5.5.5.5 update run completed, afi 0, ran for 4ms, neighbor
version 0, start version 5, throttled to 5
04:21:09: BGP: 5.5.5.5 initial update completed
04:21:09: BGP(0): 5.5.5.5 rcvd UPDATE w/ attr: nexthop 5.5.5.5, origin i,
localpref 100, path (65000) 600 400
04:21:09: BGP(0): 5.5.5.5 rcvd 10.1.1.0/24
04:21:09: BGP(0): 5.5.5.5 rcvd 10.2.2.0/24
04:21:09: BGP(0): 5.5.5.5 rcvd UPDATE w/ attr: nexthop 5.5.5.5, origin ?,
localpref 100, path (65000) 600 400
04:21:09: BGP(0): 5.5.5.5 rcvd 137.5.0.0/24
04:21:09: BGP(0): 5.5.5.5 rcvd 137.20.103.0/24
04:21:09: BGP(0): Revise route installing 10.1.1.0/24 -> 5.5.5.5 to main IP
table
04:21:09: BGP(0): Revise route installing 10.2.2.0/24 -> 5.5.5.5 to main IP
table
04:21:09: BGP(0): Revise route installing 137.5.0.0/24 -> 5.5.5.5 to main IP
table
04:21:09: BGP(0): Revise route installing 137.20.103.0/24 -> 5.5.5.5 to main
IP table
04:21:09: BGP(0): 2.2.2.2 computing updates, afi 0, neighbor version 5,
table version 9, starting at 0.0.0.0
04:21:09: BGP(0): 2.2.2.2 NEXT_HOP part 1 net 10.1.1.0/24, next 5.5.5.5
04:21:09: BGP(0): 2.2.2.2 send UPDATE (format) 10.1.1.0/24, next 5.5.5.5,
metric 20, path (65000) 600 400
04:21:09: BGP(0): 2.2.2.2 NEXT_HOP part 1 net 10.2.2.0/24, next 5.5.5.5
04:21:09: BGP(0): 2.2.2.2 send UPDATE (format) 10.2.2.0/24, next 5.5.5.5,
metric 10, path (65000) 600 400
04:21:09: BGP(0): 2.2.2.2 NEXT_HOP part 1 net 137.5.0.0/24, next 5.5.5.5
04:21:09: BGP(0): 2.2.2.2 send UPDATE (format) 137.5.0.0/24, next 5.5.5.5,
metric 20, path (65000) 600 400
04:21:09: BGP(0): 2.2.2.2 NEXT_HOP part 1 net 137.20.103.0/24, next 5.5.5.5
04:21:09: BGP(0): 2.2.2.2 send UPDATE (prepend, chgflags: 0x208)
137.20.103.0/24, next 5.5.5.5, metric 20, path (65000) 600 400
04:21:09: BGP(0): 2.2.2.2 3 updates enqueued (average=66, maximum=69)
04:21:09: BGP(0): 2.2.2.2 update run completed, afi 0, ran for 4ms, neighbor
version 5, start version 9, throttled to 9
04:21:10: BGP(0): 2.2.2.2 rcv UPDATE about 10.1.1.0/24 -- withdrawn
04:21:10: BGP(0): 2.2.2.2 rcv UPDATE about 10.2.2.0/24 -- withdrawn
04:21:10: BGP(0): 2.2.2.2 rcv UPDATE about 137.5.0.0/24 -- withdrawn
04:21:10: BGP(0): 2.2.2.2 rcv UPDATE about 137.20.103.0/24 -- withdrawn
04:21:39: BGP(0): 5.5.5.5 computing updates, afi 0, neighbor version 5,
table version 9, starting at 0.0.0.0
04:21:39: BGP(0): 5.5.5.5 send unreachable 10.1.1.0/24
04:21:39: BGP(0): 5.5.5.5 send UPDATE 10.1.1.0/24 -- unreachable
04:21:39: BGP(0): 5.5.5.5 send UPDATE 10.2.2.0/24 -- unreachable
04:21:39: BGP(0): 5.5.5.5 send UPDATE 137.5.0.0/24 -- unreachable
04:21:39: BGP(0): 5.5.5.5 send UPDATE 137.20.103.0/24 -- unreachable
04:21:39: BGP(0): 5.5.5.5 1 updates enqueued (average=39, maximum=39)
04:21:39: BGP(0): 5.5.5.5 update run completed, afi 0, ran for 0ms, neighbor
version 5, start version 9, throttled to 9
r1#sh ip bgp
BGP table version is 9, local router ID is 137.20.1.33
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/24 5.5.5.5 20 100 0 (65000) 600 400
i
*> 10.2.2.0/24 5.5.5.5 10 100 0 (65000) 600 400
i
*> 137.5.0.0/24 5.5.5.5 20 100 0 (65000) 600 400
?
*> 137.20.103.0/24 5.5.5.5 20 100 0 (65000) 600 400
?

Thanks again in advance,
Jeff



This archive was generated by hypermail 2.1.4 : Fri Jun 21 2002 - 06:45:11 GMT-3