Reset Search
 

 

Article

Will next hop update for static routes with OSPF recursion, when OSPF changes happen

« Go Back

Information

 
TitleWill next hop update for static routes with OSPF recursion, when OSPF changes happen
Question
Will next hop update for static routes with OSPF recursion, when OSPF changes happen
Environment
  • NetIron Software 
Answer
It is possible to configured a static route on MLX that will not point to a directly connected interface. The next hop for that route can be something resolved with in a different way, e.g. BGP, OSPF, ISIS or another static route. When a dynamic routing protocol is used to resolve that next hop and the best path to it points to a different interface, recursive static route will also get updated correspondingly to reflect network changes.
Additional notes
The example below illustrates next hop changes. MLX3 router is connected with iBGP and OSPF to MLX1 and MLX2. MLX1 and MLX2 in their turn are connected with eBGP to another device that injects 1.1.1.0/24 network and configured with 1.1.1.1 IP address for testing. On MLX3 Ve13 is connected on MLX1 and Ve23 to MLX2
mlx3#sh ip os ne 
    Number of Neighbors is 2, in FULL state 2
    
    Port   Address         Pri State      Neigh Address   Neigh ID        Ev Opt Cnt
    v13    10.23.13.3      1   FULL/BDR   10.23.13.1      10.23.0.1       5  66  0
    v23    10.23.23.3      1   FULL/BDR   10.23.23.2      10.23.0.2       5  66  0

Initially the route is learned via BGP and MLX1 is selected as the best route on MLX3
mlx3#sh ip route 1.1.1.1   
Type Codes - B:BGP D:Connected I:ISIS O:OSPF R:RIP S:Static; Cost - Dist/Metric
BGP  Codes - i:iBGP e:eBGP
ISIS Codes - L1:Level-1 L2:Level-2
OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 s:Sham Link
STATIC Codes - d:DHCPv6
        Destination        Gateway         Port           Cost          Type Uptime src-vrf
1       1.1.1.0/24         10.23.13.1      ve 13          200/0         Bi   3d22h  - 
mlx3#
mlx3#traceroute 1.1.1.1

Type Control-c to abort
Tracing the route to IP node (1.1.1.1) from 1 to 30 hops

  1    <1 ms   <1 ms   <1 ms 10.23.13.1 
  2    <1 ms   <1 ms   <1 ms 1.1.1.1 

mlx3(config)#sh ip route 10.23.0.2 
Type Codes - B:BGP D:Connected I:ISIS O:OSPF R:RIP S:Static; Cost - Dist/Metric
BGP  Codes - i:iBGP e:eBGP
ISIS Codes - L1:Level-1 L2:Level-2
OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 s:Sham Link
STATIC Codes - d:DHCPv6
        Destination        Gateway         Port           Cost          Type Uptime src-vrf
1       10.23.0.2/32       10.23.23.2      ve 23          110/2         O    2d16h  -

The static route is then configured with next hop being loopback interface of MLX2. In the beginning that route is not installed into routing table
mlx3(config)#ip route 1.1.1.0 255.255.255.0 10.23.0.2 

mlx3(config)#sh ip route 1.1.1.1                      
Type Codes - B:BGP D:Connected I:ISIS O:OSPF R:RIP S:Static; Cost - Dist/Metric
BGP  Codes - i:iBGP e:eBGP
ISIS Codes - L1:Level-1 L2:Level-2
OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 s:Sham Link
STATIC Codes - d:DHCPv6
        Destination        Gateway         Port           Cost          Type Uptime src-vrf
1       1.1.1.0/24         10.23.13.1      ve 13          200/0         Bi   3d22h  -
Once recursive resolution of static routes via OSPF is enabled the route appears in the table. At that point the best path will switch to MLX2
mlx3(config)#ip route next-hop ospf 

mlx3(config)#sh ip route 1.1.1.1    
Type Codes - B:BGP D:Connected I:ISIS O:OSPF R:RIP S:Static; Cost - Dist/Metric
BGP  Codes - i:iBGP e:eBGP
ISIS Codes - L1:Level-1 L2:Level-2
OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 s:Sham Link
STATIC Codes - d:DHCPv6
        Destination        Gateway         Port           Cost          Type Uptime src-vrf
1       1.1.1.0/24         10.23.23.2      ve 23          1/1           S    0m7s   - 

mlx3#traceroute 1.1.1.1

Type Control-c to abort
Tracing the route to IP node (1.1.1.1) from 1 to 30 hops

  1     3 ms   <1 ms   <1 ms 10.23.23.2 
  2    <1 ms   <1 ms   <1 ms 1.1.1.1

Next the OSPF cost is increased on Ve23, so that Ve13 to MLX1 becomes a better path to reach loopback of MLX2 from MLX3 point of view
mlx3(config)#int ve 23 
    mlx3(config-vif-23)#ip os cost 10 
    
    mlx3#sh ip route 10.23.0.2 
    Type Codes - B:BGP D:Connected I:ISIS O:OSPF R:RIP S:Static; Cost - Dist/Metric
    BGP  Codes - i:iBGP e:eBGP
    ISIS Codes - L1:Level-1 L2:Level-2
    OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 s:Sham Link
    STATIC Codes - d:DHCPv6
            Destination        Gateway         Port           Cost          Type Uptime src-vrf
    1       10.23.0.2/32       10.23.13.1      ve 13          110/3         O    0m8s   -

Together with that the recursive static route will also be updated and the best path to 1.1.1.0/24 network will switch back to MLX1
mlx3#sh ip route 1.1.1.1
    Type Codes - B:BGP D:Connected I:ISIS O:OSPF R:RIP S:Static; Cost - Dist/Metric
    BGP  Codes - i:iBGP e:eBGP
    ISIS Codes - L1:Level-1 L2:Level-2
    OSPF Codes - i:Inter Area 1:External Type 1 2:External Type 2 s:Sham Link
    STATIC Codes - d:DHCPv6
            Destination        Gateway         Port           Cost          Type Uptime src-vrf
    1       1.1.1.0/24         10.23.13.1      ve 13          1/1           S    0m30s  - 
    
    mlx3#traceroute 1.1.1.1                
    
    Type Control-c to abort
    Tracing the route to IP node (1.1.1.1) from 1 to 30 hops
    
      1    <1 ms   <1 ms   <1 ms 10.23.13.1 
      2    <1 ms   <1 ms   <1 ms 1.1.1.1



 

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255