Search This Blog

Tuesday, December 25, 2012

BGP best-path cost community


This post I would like to show the effect of BGP best-path cost community on an EIGRP MPLS VPN Layer-3 topology.

More technical information can be found in the following URLs:



Now let’s have the following topology:

 

R1, R3 and R4 are all PE routers

R2 is P router

R5 and R6 are CE routers located on VRF RED

All SP routers (R1, R2, R3 and R4) are running ISIS, LDP, BGP and MP-BGP while PE to CE routing protocol is EIGRP.

R5 is advertising network 192.168.51.0/24 while R6 is advertising network 192.168.61.0/24 and default route. Note that R5 is multi-homed and connected to both R3 and R4.

Now let’s have a look on R5 routing table:

R5#show 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 10.1.35.3 to network 0.0.0.0
 
D    192.168.61.0/24 [90/133120] via 10.1.35.3, 00:12:25, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
D       10.1.16.0 [90/5120] via 10.1.35.3, 00:12:25, FastEthernet0/0
C       10.1.45.0 is directly connected, FastEthernet0/1
C       10.1.35.0 is directly connected, FastEthernet0/0
C    192.168.51.0/24 is directly connected, Loopback1
D*EX 0.0.0.0/0 [170/7680] via 10.1.35.3, 00:12:25, FastEthernet0/0

 Note that R3 is the best path to R6 networks (default and 192.168.61.0/24).

Now let’s look on R4 VRF routing table:

R4#show ip route vrf RED
 
Routing Table: RED
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 1.1.1.1 to network 0.0.0.0
 
B    192.168.61.0/24 [200/156160] via 1.1.1.1, 01:32:13
     10.0.0.0/24 is subnetted, 3 subnets
B       10.1.16.0 [200/0] via 1.1.1.1, 01:32:13
C       10.1.45.0 is directly connected, FastEthernet1/1
B       10.1.35.0 [200/0] via 3.3.3.3, 01:32:13
B    192.168.51.0/24 [200/130560] via 3.3.3.3, 01:32:13
B*   0.0.0.0/0 [200/30720] via 1.1.1.1, 01:32:13

 

Note that R4 prefers R3 as the best path to network 192.168.51.0/24 which is directly connected to R5, which is connected to R4 on Fa1/1!

Viewing R4 EIGRP topology:

R4#show ip eigrp vrf RED topology
IP-EIGRP Topology Table for AS(100)/ID(10.1.45.4) Routing Table: RED
 
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
 
P 0.0.0.0/0, 1 successors, FD is 5120
        via VPNv4 Sourced (5120/0)
P 10.1.16.0/24, 1 successors, FD is 2560
        via VPNv4 Sourced (2560/0)
P 10.1.45.0/24, 1 successors, FD is 1280000
        via Connected, FastEthernet1/1
P 10.1.35.0/24, 1 successors, FD is 2560
        via VPNv4 Sourced (2560/0)
P 192.168.61.0/24, 1 successors, FD is 130560
        via VPNv4 Sourced (130560/0)
P 192.168.51.0/24, 1 successors, FD is 130560
        via VPNv4 Sourced (130560/0)
        via 10.1.45.5 (1408000/128000), FastEthernet1/1

 

Network 192.168.51.0/24 is learned from two sources, the first through MP-BGP and the second through directly connected neighbor, so how come that R4 choose the MP-BGP over EIGRP?

Looking at MP-BGP route to this network will reveal the answer:

R4#show ip bgp vpnv4 vrf RED 192.168.51.0/24
BGP routing table entry for 4:100:192.168.51.0/24, version 18
Paths: (1 available, best #1, table RED)
  Not advertised to any peer
  Local, imported path from 3:100:192.168.51.0/24
    3.3.3.3 (metric 20) from 2.2.2.2 (2.2.2.2)
      Origin incomplete, metric 130560, localpref 100, valid, internal, best
      Extended Community: RT:100:100 Cost:pre-bestpath:128:130560
        0x8800:32768:0 0x8801:100:130560 0x8802:65281:25600 0x8803:65281:1500
      Originator: 3.3.3.3, Cluster list: 2.2.2.2
      mpls labels in/out nolabel/18

 The BGP best-path cost community is the attribute which makes MP-BGP an EIGRP routes similar and gives the metric a top priority when choosing best route. A PE router will make routing decisions based on metrics even before calculate AS_PATH or weight and also treat the SP network as zero metric area.

In order to change this behavior uses the following command:

R4(config)#router bgp 65000
R4(config-router)#bgp bestpath cost-community ignore

 

And after clearing BGP peering here is the result:

R4#show ip route vrf RED
 
Routing Table: RED
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 10.1.45.5 to network 0.0.0.0
 
D    192.168.61.0/24 [90/1413120] via 10.1.45.5, 00:00:10, FastEthernet1/1
     10.0.0.0/24 is subnetted, 3 subnets
D       10.1.16.0 [90/1285120] via 10.1.45.5, 00:00:10, FastEthernet1/1
C       10.1.45.0 is directly connected, FastEthernet1/1
D       10.1.35.0 [90/1282560] via 10.1.45.5, 00:00:10, FastEthernet1/1
D    192.168.51.0/24 [90/1408000] via 10.1.45.5, 00:00:10, FastEthernet1/1
D*EX 0.0.0.0/0 [170/1287680] via 10.1.45.5, 00:00:10, FastEthernet1/1

 

And

R4#show ip eigrp vrf RED topology
IP-EIGRP Topology Table for AS(100)/ID(10.1.45.4) Routing Table: RED
 
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
 
P 0.0.0.0/0, 1 successors, FD is 1287680
        via 10.1.45.5 (1287680/7680), FastEthernet1/1
P 10.1.16.0/24, 1 successors, FD is 1285120
        via 10.1.45.5 (1285120/5120), FastEthernet1/1
P 10.1.45.0/24, 1 successors, FD is 1280000
        via Connected, FastEthernet1/1
P 10.1.35.0/24, 1 successors, FD is 1282560
        via 10.1.45.5 (1282560/2560), FastEthernet1/1
P 192.168.61.0/24, 1 successors, FD is 1413120
        via 10.1.45.5 (1413120/133120), FastEthernet1/1
P 192.168.51.0/24, 1 successors, FD is 130560
        via 10.1.45.5 (1408000/128000), FastEthernet1/1

 R4 is no longer takes MP-BGP routes as an option.

 

 

 

 

 

 

Sunday, December 23, 2012

OSPF in Frame-relay point-to-multipoint




Lab topology is hub and spoke, where R1 is the spoke and R3 and R4 are the spokes.

 
First I configured R2 as frame-relay switch:

frame-relay switching
!
interface Serial0/0
 no ip address
 encapsulation frame-relay
 clock rate 2000000
 frame-relay lmi-type cisco
 frame-relay intf-type dce
 frame-relay route 103 interface Serial0/1 301
 frame-relay route 104 interface Serial0/2 401
!
interface Serial0/1
 no ip address
 encapsulation frame-relay
 clock rate 2000000
 frame-relay lmi-type ansi
 frame-relay intf-type dce
 frame-relay route 301 interface Serial0/0 103
!
interface Serial0/2
 no ip address
 encapsulation frame-relay
 clock rate 2000000
 frame-relay lmi-type cisco
 frame-relay intf-type dce
 frame-relay route 401 interface Serial0/0 104
!

The configure R1 in point-to-multipoint manner:
interface Serial0/0.1 multipoint
 ip address 10.1.134.1 255.255.255.0
 snmp trap link-status
 no arp frame-relay
 frame-relay map ip 10.1.134.3 103 broadcast
 frame-relay map ip 10.1.134.4 104 broadcast
 frame-relay interface-dlci 103
 frame-relay interface-dlci 104
 no frame-relay inverse-arp
!

And R3 and R4 in point-to-point manner: 

R3:
interface Serial0/0
 no ip address
 encapsulation frame-relay
 clock rate 2000000
!
interface Serial0/0.1 point-to-point
 ip address 10.1.134.3 255.255.255.0
 snmp trap link-status
 frame-relay interface-dlci 301  
 no arp frame-relay
 no frame-relay inverse-arp
!

R4:
interface Serial0/0
 no ip address
 encapsulation frame-relay
 clock rate 2000000
!
interface Serial0/0.1 point-to-point
 ip address 10.1.134.4 255.255.255.0
 snmp trap link-status
 no arp frame-relay
 frame-relay interface-dlci 401  
!

Then configuring OSPF on all 3 routers advertising loopback 1 and serial0/0.1 on each, waiting few minutes and nothing happen…no adjacency, no neighbors!
Let’s look on R1 OSPF interface:

 R1#show ip ospf interface serial 0/0.1
Serial0/0.1 is up, line protocol is up
  Internet Address 10.1.134.1/24, Area 0
  Process ID 1, Router ID 192.168.11.1, Network Type NON_BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.11.1, Interface address 10.1.134.1
  No backup designated router on this network
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:05
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)

And on R3 OSPF interface:

R3#show ip ospf interface serial 0/0.1
Serial0/0.1 is up, line protocol is up
  Internet Address 10.1.134.3/24, Area 0
  Process ID 1, Router ID 192.168.31.1, Network Type POINT_TO_POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:05
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)

See the problem…

In order to solve the problem I will change the topology to on all routers to OSPF network type to point-to-multipoint which is the most ideal for NBMA topology:

R1-R3-R4:
interface Serial0/0.1
 ip ospf network point-to-multipoint
!

The result:
-          All updates are multicast
-          No DR/BDR election
-          Timers 30/120
-          No neighbor statements
-          Modify next-hop occurs

R4#show 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

O    192.168.31.0/24 [110/129] via 10.1.134.1, 00:03:26, Serial0/0.1
     192.168.11.0/32 is subnetted, 1 subnets
O       192.168.11.1 [110/65] via 10.1.134.1, 00:03:26, Serial0/0.1
C    192.168.41.0/24 is directly connected, Loopback1
     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O       10.1.134.1/32 [110/64] via 10.1.134.1, 00:03:26, Serial0/0.1
C       10.1.134.0/24 is directly connected, Serial0/0.1
O       10.1.134.3/32 [110/128] via 10.1.134.1, 00:03:26, Serial0/0.1

Next lab – OSPF PtP partial mesh.