Static routing-Track-NQA collaboration configuration example

Network requirements

As shown in Figure 38:

To ensure network availability, configure route backup and static routing-Track-NQA collaboration on Router A and Router D as follows:

Figure 38: Network diagram

Configuration procedure

  1. Configure the IP address of each interface, as shown in Figure 38. (Details not shown.)

  2. Configure Router A:

    # Configure a static route to 30.1.1.0/24 with next hop 10.1.1.2 and the default priority (60). Associate this static route with track entry 1.

    <RouterA> system-view
    [RouterA] ip route-static 30.1.1.0 24 10.1.1.2 track 1
    

    # Configure a static route to 30.1.1.0/24 with next hop 10.3.1.3 and priority 80.

    [RouterA] ip route-static 30.1.1.0 24 10.3.1.3 preference 80
    

    # Configure a static route to 10.2.1.4 with next hop 10.1.1.2.

    [RouterA] ip route-static 10.2.1.4 24 10.1.1.2
    

    # Create an NQA operation with administrator name admin and operation tag test.

    [RouterA] nqa entry admin test
    

    # Specify the ICMP echo operation type.

    [RouterA-nqa-admin-test] type icmp-echo
    

    # Specify 10.2.1.4 as the destination address of the operation.

    [RouterA-nqa-admin-test-icmp-echo] destination ip 10.2.1.4
    

    # Specify 10.1.1.2 as the next hop of the operation.

    [RouterA-nqa-admin-test-icmp-echo] next-hop ip 10.1.1.2
    

    # Configure the ICMP echo operation to repeat every 100 milliseconds.

    [RouterA-nqa-admin-test-icmp-echo] frequency 100
    

    # Configure reaction entry 1, specifying that five consecutive probe failures trigger the Track module.

    [RouterA-nqa-admin-test-icmp-echo] reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
    [RouterA-nqa-admin-test-icmp-echo] quit
    

    # Start the NQA operation.

    [RouterA] nqa schedule admin test start-time now lifetime forever
    

    # Configure track entry 1, and associate it with reaction entry 1 of the NQA operation.

    [RouterA] track 1 nqa entry admin test reaction 1
    [RouterA-track-1] quit
    
  3. Configure Router B:

    # Configure a static route to 30.1.1.0/24 with next hop 10.2.1.4.

    <RouterB> system-view
    [RouterB] ip route-static 30.1.1.0 24 10.2.1.4
    

    # Configure a static route to 20.1.1.0/24 with next hop 10.1.1.1.

    [RouterB] ip route-static 20.1.1.0 24 10.1.1.1
    
  4. Configure Router C:

    # Configure a static route to 30.1.1.0/24 with next hop 10.4.1.4.

    <RouterC> system-view
    [RouterC] ip route-static 30.1.1.0 24 10.4.1.4
    

    # Configure a static route to 20.1.1.0/24 with next hop 10.3.1.1.

    [RouterC] ip route-static 20.1.1.0 24 10.3.1.1
    
  5. Configure Router D:

    # Configure a static route to 20.1.1.0/24 with next hop 10.2.1.2 and the default priority (60). Associate this static route with track entry 1.

    <RouterD> system-view
    [RouterD] ip route-static 20.1.1.0 24 10.2.1.2 track 1
    

    # Configure a static route to 20.1.1.0/24 with next hop 10.4.1.3 and priority 80.

    [RouterD] ip route-static 20.1.1.0 24 10.4.1.3 preference 80
    

    # Configure a static route to 10.1.1.1 with next hop 10.2.1.2.

    [RouterD] ip route-static 10.1.1.1 24 10.2.1.2
    

    # Create an NQA operation with administrator name admin and operation tag test.

    [RouterD] nqa entry admin test
    

    # Specify the ICMP echo operation type.

    [RouterD-nqa-admin-test] type icmp-echo
    

    # Specify 10.1.1.1 as the destination address of the operation.

    [RouterD-nqa-admin-test-icmp-echo] destination ip 10.1.1.1
    

    # Specify 10.2.1.2 as the next hop of the operation.

    [RouterD-nqa-admin-test-icmp-echo] next-hop ip 10.2.1.2
    

    # Configure the ICMP echo operation to repeat every 100 milliseconds.

    [RouterD-nqa-admin-test-icmp-echo] frequency 100
    

    # Configure reaction entry 1, specifying that five consecutive probe failures trigger the Track module.

    [RouterD-nqa-admin-test-icmp-echo] reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
    [RouterD-nqa-admin-test-icmp-echo] quit
    

    # Start the NQA operation.

    [RouterD] nqa schedule admin test start-time now lifetime forever
    

    # Configure track entry 1, and associate it with reaction entry 1 of the NQA operation.

    [RouterD] track 1 nqa entry admin test reaction 1
    [RouterD-track-1] quit
    

Verifying the configuration

# Display track entry information on Router A.

[RouterA] display track all
Track ID: 1
  State: Positive
  Duration: 0 days 0 hours 0 minutes 32 seconds
  Tracked object type: NQA
  Notification delay: Positive 0, Negative 0 (in seconds)
  Tracked object:
    NQA entry: admin test
    Reaction: 1
    Remote IP/URL:--
    Local IP:--
    Interface:--

The output shows that the status of track entry 1 is Positive, indicating that the NQA operation has succeeded and the master route is available.

# Display the routing table of Router A.

[RouterA] display ip routing-table

Destinations : 10       Routes : 10

Destination/Mask    Proto  Pre  Cost         NextHop         Interface
10.1.1.0/24         Direct 0    0            10.1.1.1        GE1/0/1
10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
10.2.1.0/24         Static 60   0            10.1.1.2        GE1/0/1
10.3.1.0/24         Direct 0    0            10.3.1.1        GE1/0/2
10.3.1.1/32         Direct 0    0            127.0.0.1       InLoop0
20.1.1.0/24         Direct 0    0            20.1.1.1        GE1/0/3
20.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
30.1.1.0/24         Static 60   0            10.1.1.2        GE1/0/1
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

The output shows that Router A forwards packets to 30.1.1.0/24 through Router B.

# Remove the IP address of GigabitEthernet 1/0/1 on Router B.

<RouterB> system-view
[RouterB] interface gigabitethernet 1/0/1
[RouterB-GigabitEthernet1/0/1] undo ip address

# Display information about the track entry on Router A.

[RouterA] display track all
Track ID: 1
  State: Negative
  Duration: 0 days 0 hours 0 minutes 32 seconds
  Tracked object type: NQA
  Notification delay: Positive 0, Negative 0 (in seconds)
  Tracked object:
    NQA entry: admin test
    Reaction: 1
    Remote IP/URL:--
    Local IP:--
    Interface:--

The output shows that the status of the track entry is Negative, indicating that the NQA operation has failed and the master route is unavailable.

# Display the routing table of Router A.

[RouterA] display ip routing-table

Destinations : 10       Routes : 10

Destination/Mask    Proto  Pre  Cost         NextHop         Interface
10.1.1.0/24         Direct 0    0            10.1.1.1        GE1/0/1
10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
10.2.1.0/24         Static 60   0            10.1.1.2        GE1/0/1
10.3.1.0/24         Direct 0    0            10.3.1.1        GE1/0/2
10.3.1.1/32         Direct 0    0            127.0.0.1       InLoop0
20.1.1.0/24         Direct 0    0            20.1.1.1        GE1/0/3
20.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
30.1.1.0/24         Static 80   0            10.3.1.3        GE1/0/2
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

The output shows that Router A forwards packets to 30.1.1.0/24 through Router C. The backup static route has taken effect.

# Verify that hosts in 20.1.1.0/24 can communicate with the hosts in 30.1.1.0/24 when the master route fails.

[RouterA] ping -a 20.1.1.1 30.1.1.1
Ping 30.1.1.1: 56  data bytes, press CTRL_C to break
Reply from 30.1.1.1: bytes=56 Sequence=1 ttl=254 time=2 ms
Reply from 30.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 30.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 30.1.1.1: bytes=56 Sequence=4 ttl=254 time=2 ms
Reply from 30.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
--- Ping statistics for 30.1.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.00% packet loss
round-trip min/avg/max/std-dev = 1/1/2/1 ms

# Verify that the hosts in 30.1.1.0/24 can communicate with the hosts in 20.1.1.0/24 when the master route fails.

[RouterD] ping -a 30.1.1.1 20.1.1.1
Ping 20.1.1.1: 56  data bytes, press CTRL_C to break
Reply from 20.1.1.1: bytes=56 Sequence=1 ttl=254 time=2 ms
Reply from 20.1.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 20.1.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 20.1.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 20.1.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms

--- Ping statistics for 20.1.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.00% packet loss
round-trip min/avg/max/std-dev = 1/1/2/1 ms