Using next-hop-unchanged

Posted on April 11, 2010

After the next-hop-self time to talk about next-hop-unchanged. I couldn’t figure out the real life usage of this before I labbed it.

In this setup I’ll use my interAS topology

R1 and R5 will be our route reflectors, they’ll be peering through eBGP multihop only for address family vpvn4. R2 and R4 will be our ASBRs they’ll peer through eBGP on address family ipv4 with send-label and redistribute the loopbacks from both AS in OSPF.

We’ll be using the VRF CustA on the PE routers R3 and R6 for our examples, they are just exchanging connected routes for this VRF.

Here is our configuration for the RR peerings

R1-RR(config-router-af)#do sh run | s router bgp
router bgp 100
 bgp log-neighbor-changes
 neighbor 54.5.2.2 remote-as 100
 neighbor 54.5.2.2 update-source Loopback0
 neighbor 54.5.3.3 remote-as 100
 neighbor 54.5.3.3 update-source Loopback0
 neighbor 64.3.5.5 remote-as 200
 neighbor 64.3.5.5 ebgp-multihop 255
 neighbor 64.3.5.5 update-source Loopback0
 !
 address-family ipv4
  no synchronization
  neighbor 54.5.2.2 activate
  neighbor 54.5.2.2 send-community
  neighbor 54.5.2.2 route-reflector-client
  neighbor 54.5.3.3 activate
  neighbor 54.5.3.3 send-community
  neighbor 54.5.3.3 route-reflector-client
  no neighbor 64.3.5.5 activate
  no auto-summary
 exit-address-family
 !
 address-family vpnv4
  neighbor 54.5.2.2 activate
  neighbor 54.5.2.2 send-community extended
  neighbor 54.5.2.2 route-reflector-client
  neighbor 54.5.3.3 activate
  neighbor 54.5.3.3 send-community extended
  neighbor 54.5.3.3 route-reflector-client
  neighbor 64.3.5.5 activate
  neighbor 64.3.5.5 send-community extended
 exit-address-family
R5-RR(config-router-af)#do sh run | s router bgp
router bgp 200
 bgp log-neighbor-changes
 neighbor 54.5.1.1 remote-as 100
 neighbor 54.5.1.1 ebgp-multihop 255
 neighbor 54.5.1.1 update-source Loopback0
 neighbor 64.3.4.4 remote-as 200
 neighbor 64.3.4.4 update-source Loopback0
 neighbor 64.3.6.6 remote-as 200
 neighbor 64.3.6.6 update-source Loopback0
 !
 address-family ipv4
  no synchronization
  no neighbor 54.5.1.1 activate
  neighbor 64.3.4.4 activate
  neighbor 64.3.4.4 send-community
  neighbor 64.3.4.4 route-reflector-client
  neighbor 64.3.6.6 activate
  neighbor 64.3.6.6 send-community
  neighbor 64.3.6.6 route-reflector-client
  no auto-summary
 exit-address-family
 !
 address-family vpnv4
  neighbor 54.5.1.1 activate
  neighbor 54.5.1.1 send-community extended
  neighbor 64.3.4.4 activate
  neighbor 64.3.4.4 send-community extended
  neighbor 64.3.4.4 route-reflector-client
  neighbor 64.3.6.6 activate
  neighbor 64.3.6.6 send-community extended
  neighbor 64.3.6.6 route-reflector-client
 exit-address-family

Lets see the routes on our PE’s

R3-PE(config-router-af)#do sh ip route vrf CustA

Routing Table: CustA
Codes: L - local, 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, + - replicated route

Gateway of last resort is not set

      150.1.0.0/24 is subnetted, 1 subnets
B        150.1.6.0 [200/0] via 64.3.5.5, 00:04:50
      150.2.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        150.2.3.0/24 is directly connected, Loopback100
L        150.2.3.3/32 is directly connected, Loopback100
R6-PE#sh ip route vrf CustA

Routing Table: CustA
Codes: L - local, 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, + - replicated route

Gateway of last resort is not set

      150.1.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        150.1.6.0/24 is directly connected, Loopback100
L        150.1.6.6/32 is directly connected, Loopback100
      150.2.0.0/24 is subnetted, 1 subnets
B        150.2.3.0 [200/0] via 54.5.1.1, 00:00:12

As we can see and this is expected the next hops have been changed by our MP-eBGP session, the next hops are the route reflectors. Will this give us a problem? No as you can see we can ping no problem

R3-PE(config-router-af)#do ping vrf CustA 150.1.6.6

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.6.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/47/60 ms

The problem we have is that you may be taking a suboptimal path and sending all traffic to the RR. This has no impact in our lab environment but in production imagine 1000s of customers sending all traffic to RR before joining the PE router.

R3-PE(config-router-af)#do trace vrf CustA 150.1.6.6

Type escape sequence to abort.
Tracing the route to 150.1.6.6

  1 78.3.23.2 [MPLS: Labels 21/19 Exp 0] 52 msec 48 msec 32 msec
  2 90.9.24.4 [MPLS: Labels 16/19 Exp 0] 36 msec 32 msec 24 msec
  3 88.3.45.5 [MPLS: Label 19 Exp 0] 40 msec 36 msec 12 msec
  4 88.3.45.4 [MPLS: Labels 18/20 Exp 0] 32 msec 28 msec 60 msec
  5 150.1.6.6 36 msec *  28 msec

From this output the traffic is going through R3-PE -> R2-ASBR -> R4-ASBR -> R5-RR -> R4-ASBR -> R6-PE very suboptimal as you can see!

There is an easy way to correct this through the command neighbor x.x.x.x next-hop-unchanged of course you need all the PE routers to be advertised in you IGP.

Lets give it a try

R1-RR(config-router-af)# neighbor 64.3.5.5 next-hop-unchanged
R3-PE(config-router-af)#do sh ip route vrf CustA

Routing Table: CustA
Codes: L - local, 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, + - replicated route

Gateway of last resort is not set

      150.1.0.0/24 is subnetted, 1 subnets
B        150.1.6.0 [200/0] via 64.3.6.6, 00:21:33
      150.2.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        150.2.3.0/24 is directly connected, Loopback100
L        150.2.3.3/32 is directly connected, Loopback100
R3-PE(config-router-af)#do trace vrf CustA 150.1.6.6

Type escape sequence to abort.
Tracing the route to 150.1.6.6

  1 78.3.23.2 [MPLS: Labels 22/20 Exp 0] 32 msec 32 msec 44 msec
  2 90.9.24.4 [MPLS: Labels 18/20 Exp 0] 28 msec 12 msec 32 msec
  3 150.1.6.6 28 msec *  36 msec

Way better our traffic now goes R3-PE -> R2-ASBR -> R4-ASBR -> R6-PE

This command is very usefull in Option C InterAS, we’ll see that in another post.


No Replies to "Using next-hop-unchanged"


    Got something to say?

    Some html is OK