cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1073
Views
8
Helpful
11
Replies

Can't use a network address as next-hop for a static route.

ThomasD86
Level 1
Level 1

Hi,

I am working with a topology made up by 4 routers: A, P,B and C.

Routers A, P and B have OSPF and MPLS running between them. Router C is directly connected to B, runs no routing protocols and has a default route that points towards B. Router B and C are utilising the network 172.16.0.0/31 for connectivity with .0 configured on B and .1 on C. Router P is a LSR and sits in between A and B, it has an OSPF neighborship with both A and B. The links between A,P and B are mpls enabled. The one between B and C is not.

I created a loopback interface on Router C and the goal is to ping this interface from router A.

Here's what I did:

-Configured a static on router B that points to the loopback on C. After configuring it, I can now ping the loopback interface I created on C from B just fine.
-Advertised the 172.16.0.0/31 network configured on the link between B and C in OSPF. Router P and A both learn the route and can ping both IPs in the network.
-Configured on A a static route that points towards the loopback of router C with 172.16.0.1 as next-hop. The ping fails.
However, if I configure on A a static route that utilizes as next-hop router C ospf id address then the ping will work.

While I fixed this, I cannot quite figure out the reason why it wouldn't work when the next hop is "172.16.0.1". Just like Router B OSPF router-id address, router A knows 172.16.0.1 through OSPF and I can ping it from A.
Router B can also reach the interface utilized as ping source on Router A.

So, both next-hop addresses seem equally valid to me but obviously, there's some knowledge I am lacking. Could anyone kindly explain to me why it works with one address but not the other?

11 Replies 11

This is pure routing issue I think 

It not relate to mpls 

The router B if not advertise route of C how A and P know this route?

As I understand you use default route in C 

So you need to use static route in B toward C for any prefix behind C and advertise this static route into ospf 

MHM

IT is like this:

RA<--->P<--->B<-.0--172.16.0.0/31--.1->RC

Router A knows C loopback through a static route that has 172.16.0.1 as next-hop. Router A knows 172.16.0.1 through OSPF, Router A can ping 172.16.0.1
Router P doesn't know C loopback but it is a LSR, Router P knows 172.16.0.1 through OSPF as well
Router B has a static for the loopback on C.

On router A configuring a static like this:

router static
address-family ipv4 unicast
3.3.3.3/32 (router C loopback) 172.16.0.1 (Router C interface in the link between B and C. Router A can ping this  IP)

doesn't work

if I replace 172.16.0.1 with router B loopback interface, it works. If router A can reach 172.16.0.1 (C interface) why it cannot reach the loopback that is configured on same router?

I run lab and it work 
change the subnet between B and C and check again 
the OSPF and MPLS not accept subnet 17216.0.0/31 <<- this need to be 30 and dont use .0 this network ID not host IP
Screenshot (101).png

Hi @ThomasD86 ,

What IOS-XR version do you run on Router A?

Can you please provide a "show cef 3.3.3.3 det" from Router A?

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Hi Harold,

Router A is an ASR9k running 7.3.2, Router P is a NCS 5508 running 7.3.2 as well. Router B is another 9k running 7.9.21.

The CEF output shows that something might not be right. I configured both static routes towards router C, one with next hop 172.16.0.235, the other with 172.16.0.50. Router A installs both in its routing table:

 

 

S    3.3.3.3/32 [1/0] via 172.16.0.235, 00:22:15
                     [1/0] via 172.16.55.50, 00:22:15

 

 

Looking at the cef however:

 

 

show cef 30.235.9.117/32 detail 
Sat Feb 17 09:22:36.058 CET
30.235.9.117/32, version 493326, internal 0x1000001 0x30 (ptr 0x7904f380) [1], 0x0 (0x7900aef8), 0xa00 (0x8970c0a8)
 Updated Feb 17 09:03:43.819
 Prefix Len 32, traffic index 0, precedence n/a, priority 3
  gateway array (0x78e75408) reference count 2, flags 0x8078, source lsd (5), 1 backups
                [3 type 4 flags 0x108441 (0x794f9e40) ext 0x0 (0x0)]
  LW-LDI[type=1, refc=1, ptr=0x7900aef8, sh-ldi=0x794f9e40]
  gateway array update type-time 1 Feb 17 09:03:43.820
 LDI Update time Feb 17 09:03:43.826
 LW-LDI-TS Feb 17 09:03:43.826
   via 172.16.0.235/32, 3 dependencies, recursive [flags 0x0]
    path-idx 0 NHID 0x0 [0x7904ee08 0x0]
    next hop 172.16.0.235/32 via 172.16.0.235/32
     local label 24002 
     next hop 172.16.6.24/32 Hu0/0/0/1    labels imposed {28115 None}
   via 172.16.55.50/32, 3 dependencies, recursive [flags 0x0]
    path-idx 1 NHID 0x0 [0x7904e188 0x0]
    next hop 172.16.55.50/32 via 172.16.55.50/31
     local label 24002 
     next hop 172.16.6.24/32 Hu0/0/0/1    labels imposed {None} <<< no label when next hop is 172.16.55.50

    Load distribution: 0 1 (refcount 3)

    Hash  OK  Interface                 Address
    0     Y   recursive                 172.16.0.235   
    1     Y   recursive                 172.16.55.50   
 

 

 

 It looks like A is not receiving a label to forward traffic to 172.16.55.50.

Router P has no entry for 3.3.3.3 in its cef but looking at the ldp bindings:

 

 

RP/0/RP0/CPU0:NCS-01#show mpls ldp binding 3.3.3.3/32
Sat Feb 17 09:36:08.775 CET
3.3.3.3/32, rev 0
        No local binding 
        Remote bindings: (2 peers)
            Peer                Label    
            -----------------   ---------
            172.16.0.48:0       24002   
            172.16.0.235:0      24024   
RP/0/RP0/CPU0:NCS-01#show mpls ldp binding 172.16.55.50/32
Sat Feb 17 09:36:23.919 CET
RP/0/RP0/CPU0:NCS-01#show mpls ldp binding 172.16.0.235/32
Sat Feb 17 09:36:32.767 CET
172.16.0.235/32, rev 256
        Local binding: label: 28115
        Remote bindings: (7 peers)
            Peer                Label    
            -----------------   ---------
            172.16.128.5:0      24004   
            172.16.0.43:0       65      
            172.16.0.47:0       133     
            172.16.0.48:0       24123   
            192.168.0.140:0     54      
            192.168.0.141:0     24119   
            172.16.0.235:0      ImpNull 

 

It looks that Router B is not passing to P a label for 172.16.55.50/31.

So if I am getting these outputs right: There's no LSP from A to 172.16.55.50.
Ping towards 172.16.55.50 from A works solely because since the network is known in OSPF to P it can route the packet using the ip header infos even if the LSP is broken. However since no mpls encapsulation is happening when trying to ping 3.3.3.3 router P not having this network in its routing table and not being able to use the mpls header for routing since there's none, drops the packet. 
Is this correct?
I've made a topology of the scenario to better help understand the outputs:

Lab Topology.jpg

I dont like use /31 but since you need to use it I run lab again and also it work
in router 3 I add 120.0.0.0 0.0.0.1 area 0 under the ospf, this make R3 advertise the prefix with it label to both R2 and R1
R1 will use ip route 4.4.4.4/32 120.0.0.0
R1 know the prefix 120.0.0.0 and it label
so first step in your case is check 
are router R1 (R-A) use static route toward R3 IP not R4 IP ?
are R1 know this subnet between R3-R4 via OSPF and add it to MPLS table ?

Screenshot (102).png

Screenshot (104).pngScreenshot (105).pngScreenshot (106).png

ThomasD86
Level 1
Level 1

Hi,

thanks for sharing the outputs. In my case the problem seems to be that Router P (R2 in your lab) has no label for the network between B and C (R3 and R4) it knows the network from OSPF but it hasn't assigned a label to it.

Looking at router P:

show mpls ldp neighbor 172.16.0.235
Sat Feb 17 11:38:25.627 CET

Peer LDP Identifier: 172.16.0.235:0
  TCP connection: 172.16.0.235:36332 - 172.16.0.44:646
  Graceful Restart: No
  Session Holdtime: 180 sec
  State: Oper; Msgs sent/rcvd: 29603/29607; Downstream-Unsolicited
  Up time: 2w3d
  LDP Discovery Sources:
    IPv4: (2)
      Targeted Hello (172.16.0.44 -> 172.16.0.235, active)
      Bundle-Ether1
    IPv6: (0)
  Addresses bound to this peer:
    IPv4: (5)
      172.16.0.235   172.16.55.49   172.16.55.51   200.100.10.0   
      200.100.10.2   

Router P recognizes that 172.16.55.51 is bound to B.

However, looking at the forwarding info:

show mpls forwarding 
Sat Feb 17 11:40:40.729 CET
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
24000  Pop         No ID              BD=3 EIM     point2point     0           
28096  Pop         EVPN:600 U         BD=3 E       point2point     0           
28106  Unlabelled  192.168.0.140/32   Te0/0/0/29/0 192.168.0.133   57211366    
28110  Unlabelled  2.2.2.2/32         Te0/0/0/29/1 192.168.0.137   0           
28111  Pop         192.168.0.141/32   Te0/0/0/29/1 192.168.0.137   42255519    
28112  Pop         192.168.0.142/32   Te0/0/0/29/1 192.168.0.137   0           
28113  Pop         172.16.0.49/32     Hu0/0/0/9    172.16.6.29     485982      
28114  Pop         172.16.128.5/32    Hu0/0/0/9    172.16.6.29     45234600    
28115  Pop         172.16.0.235/32    BE1          172.16.55.49    1479884     
28116  Pop         172.16.0.48/32     Hu0/0/0/8    172.16.6.25     82917       
28117  Pop         172.16.128.4/32    Hu0/0/0/8    172.16.6.25     0           
28118  Pop         172.16.128.6/32    Hu0/0/0/8    172.16.6.25     0           
28121  Pop         172.16.0.43/32     Hu0/0/0/7    172.16.6.16     77179236    
28122  Pop         172.16.128.1/32    Hu0/0/0/7    172.16.6.16     0           
28123  Pop         172.16.128.100/32  Hu0/0/0/7    172.16.6.16     0           
28124  Pop         172.16.0.47/32     Te0/0/0/28/0 172.16.60.2     76679328    
28125  Pop         172.16.128.3/32    Te0/0/0/28/0 172.16.60.2     0           
28126  Pop         199.200.100.1/32   Hu0/0/0/8    172.16.6.25     0           
28127  Unlabelled  BLB(BE1/172.16.55.49)   \
                                      BE1          172.16.55.49    0           

Router P has no label allocated to reach network 172.16.55.50/31, despite knowing the network:

Routing entry for 172.16.55.50/31
  Known via "ospf 1", distance 110, metric 20, type intra area
  Installed Feb 17 11:42:50.993 for 00:00:34
  Routing Descriptor Blocks
    172.16.55.49, from 172.16.0.235, via Bundle-Ether1
      Route metric is 20
  No advertising protos. 

I figured this out:

In MPLS LDP configuration, all the 3 routers (A,P and B) were configured to allocate labels only for host routes since I was pointing to a non host route no LSP was created and thus the ping failed:

mpls ldp
 log
  neighbor
  nsr
  graceful-restart
 !
 igp sync delay on-session-up 30
 discovery
  hello holdtime 30
  hello interval 10
  targeted-hello holdtime 120
  targeted-hello interval 15
 !
 router-id 172.16.0.235
 session protection
 address-family ipv4
  discovery targeted-hello accept
  label
   local
    allocate for host-routes

Removing the allocate for host-routes bit from all 3 routers, generated a valid LSP.

Thanks for the help everyone!

You are welcome 

Have a nice weekend 

MHM

Good catch @ThomasD86 and thanks for the feedback

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

In R3 add new LO 3.3.3.3 and advertise via ospf 

Make sure R2 know this new LO vis RIB and MPLS forwarding table

In R1 add static  route for R4LO Toward LO in R3 (make this LO 3.3.3.3) 

This must work.

MHM

Review Cisco Networking for a $25 gift card