Routing

last person joined: 2 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  static route failover and qualified-next-hop

    Posted 06-20-2013 03:27

    Hi Everyone, 

    Im starting out with Junos, so please bare with me if this seems a dumb question.

    Ive setup 4 routers in a test environment. A, B, C and D

    Im trying to set up a static route on A so that it can contact D should either B or C go down. From what I have read this should do the trick:

     

    [edit] routing-options
    static {
        route 192.168.58.2/32 { #D'S IP
          next-hop 192.168.57.3; #B's IP
          qualified-next-hop 192.168.57.4 { #C'S IP
        preference 5;
        }
      preference 6;
      }
    
    So I'm reading that as: if we need to route to 192.168.58.2, go via 192.168.57.3 if its available (preference 6) but if its not, go via 192.168.57.4 But when I try and simulate B going down by issuing
    set interface em1 disable
    commit
    
    A continues to try and use B as the next hop. What am I missing? Thanks in advance!


  • 2.  RE: static route failover and qualified-next-hop

    Posted 06-20-2013 04:21

    Hi,

     

    Can you please draw a Diagram of the 4 routers?



  • 3.  RE: static route failover and qualified-next-hop
    Best Answer

    Posted 06-20-2013 04:27

    Hi,

     

    If you want a good example like on what you are asking. 

    Here is a good example of it:

    You can find this here:

    http://www.juniper.net/techpubs/en_US/junos12.1/topics/topic-map/policy-static-route-selection.html

     

    Overview

    In this example, the static route 192.168.47.0/24 has two possible next hops. Because one link has higher bandwidth, this link is the preferred path. To enforce this preference, the qualified-next-hop statement is included in the configuration on both devices. See Figure 1.

    Figure 1: Controlling Static Route Selection

    Configuration

    CLI Quick Configuration

    To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

    Device B

    set interfaces ge-1/2/0 unit 0 description B->Dset interfaces ge-1/2/0 unit 0 family inet address 172.16.1.1/24set interfaces fe-1/2/1 unit 2 description secondary-B->Dset interfaces fe-1/2/1 unit 2 family inet address 192.168.2.1/24set interfaces lo0 unit 57 family inet address 10.0.0.1/32set interfaces lo0 unit 57 family inet address 10.0.0.2/32set routing-options static route 192.168.47.0/24 next-hop 172.16.1.2set routing-options static route 192.168.47.0/24 qualified-next-hop 192.168.2.2 preference 25

    Device D

    set interfaces ge-1/2/0 unit 1 description D->Bset interfaces ge-1/2/0 unit 1 family inet address 172.16.1.2/24set interfaces fe-1/2/1 unit 3 description secondary-D->Bset interfaces fe-1/2/1 unit 3 family inet address 192.168.2.2/24set interfaces lo0 unit 2 family inet address 192.168.47.5/32set interfaces lo0 unit 2 family inet address 192.168.47.6/32set routing-options static route 0.0.0.0/0 next-hop 172.16.1.1set routing-options static route 0.0.0.0/0 qualified-next-hop 192.168.2.1 preference 25

    Step-by-Step Procedure

    The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide .

    To control static route selection:

    1. On Device B, configure the interfaces.
      [edit interfaces]user@B# set ge-1/2/0 unit 0 description B->Duser@B# set ge-1/2/0 unit 0 family inet address 172.16.1.1/24user@B# set fe-1/2/1 unit 2 description secondary-B->Duser@B# set fe-1/2/1 unit 2 family inet address 192.168.2.1/24user@B# set lo0 unit 57 family inet address 10.0.0.1/32user@B# set lo0 unit 57 family inet address 10.0.0.2/32
    2. On Device B, configure a static route to the customer network.
      [edit routing-options static route 192.168.47.0/24]user@B# set next-hop 172.16.1.2
    3. On Device B, configure a backup route to the customer network.
      [edit routing options static route 192.168.47.0/24]user@B# set qualified-next-hop 192.168.2.2 preference 25
    4. On Device D, configure the interfaces.
      [edit interfaces]user@D# set ge-1/2/0 unit 1 description D->Buser@D# set ge-1/2/0 unit 1 family inet address 172.16.1.2/24user@D# set fe-1/2/1 unit 3 description secondary-D->Buser@D# set fe-1/2/1 unit 3 family inet address 192.168.2.2/24user@D# set lo0 unit 2 family inet address 192.168.47.5/32user@D# set lo0 unit 2 family inet address 192.168.47.6/32
    5. On Device D, configure a static default route to external networks.
      [edit routing options static route 0.0.0.0/0]user@D# set next-hop 172.16.1.1
    6. On Device D, configure a backup static default route to external networks.
      [edit routing options static route 0.0.0.0/0]user@D# set qualified-next-hop 192.168.2.1 preference 25

    Results

    Confirm your configuration by issuing the show interfaces and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

    user@B# show interfacesge-1/2/0 {unit 0 {description B->D;family inet {address 172.16.1.1/24;}}}fe-1/2/1 {unit 2 {description secondary-B->D;family inet {address 192.168.2.1/24;}}}lo0 {unit 57 {family inet {address 10.0.0.1/32;address 10.0.0.2/32;}}}
    user@B# show routing-optionsstatic {route 192.168.47.0/24 {next-hop 172.16.1.2;qualified-next-hop 192.168.2.2 {preference 25;}}}
    user@D# show interfacesge-1/2/0 {unit 1 {description D->B;family inet {address 172.16.1.2/24;}}}fe-1/2/1 {unit 3 {description secondary-D->B;family inet {address 192.168.2.2/24;}}}lo0 {unit 2 {family inet {address 192.168.47.5/32;address 192.168.47.6/32;}}}
    user@D# show routing-optionsstatic {route 0.0.0.0/0 {next-hop 172.16.1.1;qualified-next-hop 192.168.2.1 {preference 25;}}}
     

    If you are done configuring the devices, enter commit from configuration mode on both devices.

    Verification

    Confirm that the configuration is working properly.

    Checking the Routing Tables

    Purpose

    Make sure that the static routes appear in the routing tables of Device B and Device D.

    Action

    user@B> show route protocol static
    inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    192.168.47.0/24    *[Static/5] 02:02:03
                        > to 172.16.1.2 via ge-1/2/0.0
                        [Static/25] 01:58:21
                        > to 192.168.2.2 via fe-1/2/1.2
    
    user@D> show route protocol static
    inet.0: 7 destinations, 8 routes (7 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    0.0.0.0/0          *[Static/5] 02:02:12
                        > to 172.16.1.1 via ge-1/2/0.1
                        [Static/25] 01:58:31
                        > to 192.168.2.1 via fe-1/2/1.3