- Table of Contents
-
- 07-Layer 3—IP Routing Configuration Guide
- 00-Preface
- 01-Basic IP routing configuration
- 02-Static routing configuration
- 03-RIP configuration
- 04-OSPF configuration
- 05-Policy-based routing configuration
- 06-IPv6 static routing configuration
- 07-RIPng configuration
- 08-OSPFv3 configuration
- 09-IPv6 policy-based routing configuration
- 10-Routing policy configuration
- 11-BGP configuration
- 12-IS-IS configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Static routing configuration | 207.89 KB |
Configuring a static route group
Configuring the DHCP-designated default router as the next hop of a static route
Configuring BFD for static routes
Configuring BFD control packet mode
Configuring BFD echo packet mode
Restrictions and guidelines for static route FRR
Configuring static route FRR by specifying a backup next hop
Configuring static route FRR to automatically select a backup next hop
Enabling BFD echo packet mode for static route FRR
Display and maintenance commands for static routing
Static route configuration examples
Example: Configuring basic static routes
Example: Configuring BFD for static routes (direct next hop)
Example: Configuring BFD for static routes (indirect next hop)
Example: Configuring static route FRR
Configuring static routing
About static routes
Static routes are manually configured. If a network's topology is simple, you only need to configure static routes for the network to work correctly.
Static routes cannot adapt to network topology changes. If a fault or a topological change occurs in the network, the network administrator must modify the static routes manually.
Configuring a static route
1. Enter system view.
system-view
2. Configure a static route.
Public network:
ip route-static dest-address { mask-length | mask } { interface-type interface-number [ next-hop-address ] | next-hop-address | vpn-instance d-vpn-instance-name next-hop-address } [ permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
By default, no static route is configured.
You can associate Track with a static route to monitor the reachability of the next hops. For more information about Track, see Network Management and Monitoring Configuration Guide.
VPN:
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } { interface-type interface-number [ next-hop-address ] | next-hop-address [ public ] | vpn-instance d-vpn-instance-name next-hop-address } [ permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
By default, no static route is configured.
You can associate Track with a static route to monitor the reachability of the next hops. For more information about Track, see Network Management and Monitoring Configuration Guide.
3. (Optional.) Configure the default preference for static routes.
ip route-static default-preference default-preference
The default setting is 60.
Configuring a static route group
About this task
This task allows you to batch create static routes with different prefixes but the same output interface and next hop.
You can create a static route group, and specify the static group in the ip route-static command. All prefixes in the static route group will be assigned the next hop and output interface specified in the ip route-static command.
Procedure
1. Enter system view.
system-view
2. Create a static route group and enter its view.
ip route-static-group group-name
By default, no static route group is configured.
3. Add a static route prefix to the static route group.
prefix dest-address { mask-length | mask }
By default, no static route prefix is added to the static route group.
4. Return to system view.
quit
5. Configure a static route.
Public network:
ip route-static group group-name { interface-type interface-number [ next-hop-address ] | next-hop-address | vpn-instance d-vpn-instance-name next-hop-address } [ permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
VPN:
ip route-static vpn-instance s-vpn-instance-name group group-name { interface-type interface-number [ next-hop-address ] | next-hop-address [ public ] | vpn-instance d-vpn-instance-name next-hop-address } [ permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
By default, no static route is configured.
Configuring the DHCP-designated default router as the next hop of a static route
About this task
After an interface obtains an IP address and gateway address through DHCP, the device automatically generates a static route with the interface as the output interface. The destination address of the static route is 0.0.0.0/0 and the next hop of the static route is the default router (the gateway address designated by the DHCP server). This static route cannot form ECMP routes with manually configured static routes. The device uses this static route to guide traffic forwarding only after the manually configured static routes become invalid.
Perform this task to use both the automatically generated static route and the manually configured static routes to guide traffic forwarding. The task is applicable when the device has dual egress WAN links.
This task enables the device to automatically generate a static route destined for the specified network with the DHCP-designated default router of the output interface as the next hop. This static route takes effect only after the output interface obtains an IP address and gateway address through DHCP, and becomes invalid upon the DHCP lease expiration. The next hop of this static route changes as the gateway address of the output interface changes. In addition, this static route can form ECMP routes with manually configured static routes.
Restrictions and guidelines
When you configure the next hop of a static route as the DHCP-designated default router, make sure the output interface of the static route is a broadcast interface.
Procedure
1. Enter system view.
system-view
2. Configure a static route and specify the default router designated by the DHCP server for the output interface as the next hop of the static route.
Public network:
ip route-static { dest-address { mask-length | mask } | group group-name } interface-type interface-number dhcp [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
VPN:
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } interface-type interface-number dhcp [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name group group-name interface-type interface-number dhcp [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] ] [ preference preference ] [ tag tag-value ] [ description text ]
By default, no static route is configured with the DHCP-designated default router as the next hop.
Deleting static routes
About this task
To delete a static route, use the undo ip route-static command. To delete all static routes including the default route, use the delete static-routes all command.
Procedure
1. Enter system view.
system-view
2. Delete all static routes.
Public network:
delete static-routes all
VPN:
delete vpn-instance vpn-instance-name static-routes all
CAUTION: This command might interrupt network communication and cause packet forwarding failure. Before executing the command, make sure you fully understand the potential impact on the network. |
Configuring BFD for static routes
IMPORTANT: Enabling BFD for a flapping route could worsen the situation. |
About BFD
BFD provides a general-purpose, standard, medium-, and protocol-independent fast failure detection mechanism. It can uniformly and quickly detect the failures of the bidirectional forwarding paths between two routers for protocols, such as routing protocols.
For more information about BFD, see Network Management and Monitoring Configuration Guide.
Configuring BFD control packet mode
About this task
This mode uses BFD control packets to detect the status of a link bidirectionally at a millisecond level.
BFD control packet mode can be applied to static routes with a direct next hop or with an indirect next hop.
Restrictions and guidelines for BFD control packet mode
If you use BFD control packet mode at the local end, you must use this mode also at the peer end.
Configuring BFD control packet mode for a static route (direct next hop)
1. Enter system view.
system-view
2. Configure BFD control packet mode for a static route.
Public network:
ip route-static dest-address { mask-length | mask } interface-type interface-number { dhcp | next-hop-address } bfd { control-packet | static session-name } [ preference preference ] [ tag tag-value ] [ description text ]
VPN:
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } interface-type interface-number { dhcp | next-hop-address } bfd { control-packet | static session-name } [ preference preference ] [ tag tag-value ] [ description text ]
By default, BFD control packet mode for a static route is not configured.
Configuring BFD control packet mode for a static route (indirect next hop)
1. Enter system view.
system-view
2. Configure BFD control packet mode for a static route.
Public network:
ip route-static dest-address { mask-length | mask } { next-hop-address bfd control-packet bfd-source ip-address | vpn-instance d-vpn-instance-name next-hop-address bfd { control-packet bfd-source ip-address | static session-name } } [ preference preference ] [ tag tag-value ] [ description text ]
VPN:
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } { next-hop-address bfd { control-packet bfd-source ip-address | static session-name } | vpn-instance d-vpn-instance-name next-hop-address bfd { control-packet bfd-source ip-address | static session-name } } [ preference preference ] [ tag tag-value ] [ description text ]
By default, BFD control packet mode for a static route is not configured.
Configuring BFD echo packet mode
About this task
With BFD echo packet mode enabled for a static route, the output interface sends BFD echo packets to the destination device, which loops the packets back to test the link reachability.
Restrictions and guidelines
You do not need to configure BFD echo packet mode at the peer end.
Do not use BFD for a static route with the output interface in spoofing state.
Procedure
1. Enter system view.
system-view
2. Configure the source address of echo packets.
bfd echo-source-ip ip-address
By default, the source address of echo packets is not configured.
For more information about this command, see Network Management and Monitoring Command Reference.
3. Configure BFD echo packet mode for a static route.
Public network:
ip route-static dest-address { mask-length | mask } interface-type interface-number { dhcp | next-hop-address } bfd { echo-packet | static session-name } [ preference preference ] [ tag tag-value ] [ description text ]
VPN:
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } interface-type interface-number { dhcp | next-hop-address } bfd { echo-packet | static session-name } [ preference preference ] [ tag tag-value ] [ description text ]
By default, BFD echo packet mode for a static route is not configured.
Configuring static route FRR
About static route FRR
A link or router failure on a path can cause packet loss. Static route fast reroute (FRR) enables fast rerouting to minimize the impact of link or node failures.
As shown in Figure 1, upon a link failure, packets are directed to the backup next hop to avoid traffic interruption. You can either specify a backup next hop for FRR or enable FRR to automatically select a backup next hop (which must be configured in advance).
Restrictions and guidelines for static route FRR
Do not use static route FRR and BFD (for a static route) at the same time.
Equal-cost routes do not support static route FRR.
Besides the configured static route for FRR, the device must have another route to reach the destination. When the state of the primary link (with Layer 3 interfaces staying up) changes from bidirectional to unidirectional or down, static route FRR quickly redirects traffic to the backup next hop. When the Layer 3 interfaces of the primary link are down, static route FRR temporarily redirects traffic to the backup next hop. In addition, the device searches for another route to reach the destination and redirects traffic to the new path if a route is found. If no route is found, traffic interruption occurs.
Configuring static route FRR by specifying a backup next hop
Restrictions and guidelines
A static route does not take effect when the backup output interface is unavailable.
To change the backup output interface or next hop, you must first remove the current setting. The backup output interface and next hop must be different from the primary output interface and next hop.
Procedure
1. Enter system view.
system-view
2. Configure static route FRR.
Public network:
ip route-static dest-address { mask-length | mask } interface-type interface-number [ { dhcp | next-hop-address } [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] ] ] [ permanent ] [ preference preference ] [ tag tag-value ] [ description text ]
VPN:
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } interface-type interface-number [ { dhcp | next-hop-address } [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] ] ] [ permanent ] [ preference preference ] [ tag tag-value ] [ description text ]
By default, static route FRR is disabled.
Configuring static route FRR to automatically select a backup next hop
1. Enter system view.
system-view
2. Configure static route FRR to automatically select a backup next hop.
ip route-static fast-reroute auto
By default, static route FRR is disabled from automatically selecting a backup next hop.
Enabling BFD echo packet mode for static route FRR
About this task
By default, static route FRR uses ARP to detect primary link failures. Perform this task to enable static route FRR to use BFD echo packet mode for fast failure detection on the primary link.
Procedure
1. Enter system view.
system-view
2. Configure the source IP address of BFD echo packets.
bfd echo-source-ip ip-address
By default, the source IP address of BFD echo packets is not configured.
The source IP address cannot be on the same network segment as any local interface's IP address.
For more information about this command, see Network Management and Monitoring Command Reference.
3. Enable BFD echo packet mode for static route FRR.
ip route-static primary-path-detect bfd echo
By default, BFD echo packet mode for static route FRR is disabled.
Display and maintenance commands for static routing
Execute display commands in any view.
Task |
Command |
Display static route information. |
display ip routing-table protocol static [ inactive | verbose ] |
Display static route next hop information. |
display route-static nib [ nib-id ] [ verbose ] |
Display static routing table information. |
display route-static routing-table [ vpn-instance vpn-instance-name ] [ ip-address { mask-length | mask } ] |
For more information about the display ip routing-table protocol static [ inactive | verbose ] command, see basic IP routing in Layer 3—IP Routing Command Reference.
Static route configuration examples
Example: Configuring basic static routes
Network configuration
As shown in Figure 2, configure static routes on the devices for interconnections between any two hosts.
Procedure
1. Configure IP addresses for interfaces. (Details not shown.)
2. Configure static routes:
# Configure a default route on Device A.
<DeviceA> system-view
[DeviceA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
# Configure two static routes on Device B.
<DeviceB> system-view
[DeviceB] ip route-static 1.1.2.0 255.255.255.0 1.1.4.1
[DeviceB] ip route-static 1.1.3.0 255.255.255.0 1.1.5.6
# Configure a default route on Device C.
<DeviceC> system-view
[DeviceC] ip route-static 0.0.0.0 0.0.0.0 1.1.5.5
3. Configure the default gateways of Host A, Host B, and Host C as 1.1.2.3, 1.1.6.1, and 1.1.3.1. (Details not shown.)
Verifying the configuration
# Display the static route information on Device A.
[DeviceA] display ip routing-table protocol static
Summary Count : 1
Static Routing table Status : <Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 1.1.4.2 GE1/0/2
Static Routing table Status : <Inactive>
Summary Count : 0
# Display the static route information on Device B.
[DeviceB] display ip routing-table protocol static
Summary Count : 2
Static Routing table Status : <Active>
Summary Count : 2
Destination/Mask Proto Pre Cost NextHop Interface
1.1.2.0/24 Static 60 0 1.1.4.1 GE1/0/1
1.1.3.0/24 Static 60 0 1.1.5.6 GE1/0/2
Static Routing table Status : <Inactive>
Summary Count : 0
# Use the ping command on Host B to test the reachability of Host A (Windows XP runs on the two hosts).
C:\Documents and Settings\Administrator>ping 1.1.2.2
Pinging 1.1.2.2 with 32 bytes of data:
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Reply from 1.1.2.2: bytes=32 time=1ms TTL=126
Ping statistics for 1.1.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
# Use the tracert command on Host B to test the reachability of Host A.
C:\Documents and Settings\Administrator>tracert 1.1.2.2
Tracing route to 1.1.2.2 over a maximum of 30 hops
1 <1 ms <1 ms <1 ms 1.1.6.1
2 <1 ms <1 ms <1 ms 1.1.4.1
3 1 ms <1 ms <1 ms 1.1.2.2
Trace complete.
Example: Configuring BFD for static routes (direct next hop)
Network configuration
Configure the following, as shown in Figure 3:
· Configure a static route to subnet 120.1.1.0/24 on Device A.
· Configure a static route to subnet 121.1.1.0/24 on Device B.
· Enable BFD for both routes.
· Configure a static route to subnet 120.1.1.0/24 and a static route to subnet 121.1.1.0/24 on Device C.
When the link between Device A and Device B through the Layer 2 switch fails, BFD can detect the failure immediately. Device A then communicates with Device B through Device C.
Figure 3 Network diagram
Table 1 Interface and IP address assignment
Device |
Interface |
IP address |
Device A |
GE1/0/1 |
12.1.1.1/24 |
Device A |
GE1/0/2 |
10.1.1.102/24 |
Device B |
GE1/0/1 |
12.1.1.2/24 |
Device B |
GE1/0/2 |
13.1.1.1/24 |
Device C |
GE1/0/1 |
10.1.1.100/24 |
Device C |
GE1/0/2 |
13.1.1.2/24 |
Procedure
1. Configure IP addresses for interfaces. (Details not shown.)
2. Configure static routes and BFD:
# Configure static routes on Route A and enable BFD control packet mode for the static route that traverses the Layer 2 switch.
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] bfd min-transmit-interval 500
[DeviceA-GigabitEthernet1/0/1] bfd min-receive-interval 500
[DeviceA-GigabitEthernet1/0/1] bfd detect-multiplier 9
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] ip route-static 120.1.1.0 24 gigabitethernet 1/0/1 12.1.1.2 bfd control-packet
[DeviceA] ip route-static 120.1.1.0 24 gigabitethernet 1/0/2 10.1.1.100 preference 65
[DeviceA] quit
# Configure static routes on Device B and enable BFD control packet mode for the static route that traverses the Layer 2 switch.
<DeviceB> system-view
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] bfd min-transmit-interval 500
[DeviceB-GigabitEthernet1/0/1] bfd min-receive-interval 500
[DeviceB-GigabitEthernet1/0/1] bfd detect-multiplier 9
[DeviceB-GigabitEthernet1/0/1] quit
[DeviceB] ip route-static 121.1.1.0 24 gigabitethernet 1/0/1 12.1.1.1 bfd control-packet
[DeviceB] ip route-static 121.1.1.0 24 gigabitethernet 1/0/2 13.1.1.2 preference 65
[DeviceB] quit
# Configure static routes on Device C.
<DeviceC> system-view
[DeviceC] ip route-static 120.1.1.0 24 13.1.1.1
[DeviceC] ip route-static 121.1.1.0 24 10.1.1.102
Verifying the configuration
# Display BFD sessions on Device A.
<DeviceA> display bfd session
Total sessions: 1 Up sessions: 1 Init mode: Active
IPv4 session working in control packet mode:
LD/RD SourceIP DestinationIP State Holdtime Interface
4/7 12.1.1.1 12.1.1.2 Up 2000ms GE1/0/1
The output shows that the BFD session has been created.
# Display static routes on Device A.
<DeviceA> display ip routing-table protocol static
Summary Count : 1
Static Routing table Status : <Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
120.1.1.0/24 Static 60 0 12.1.1.2 GE1/0/1
Static Routing table Status : <Inactive>
Summary Count : 0
The output shows that Device A communicates with Device B through GigabitEthernet 1/0/1. Then the link over GigabitEthernet 1/0/1 fails.
# Display static routes on Device A.
<DeviceA> display ip routing-table protocol static
Summary Count : 1
Static Routing table Status : <Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
120.1.1.0/24 Static 65 0 10.1.1.100 GE1/0/2
Static Routing table Status : <Inactive>
Summary Count : 0
The output shows that Device A communicates with Device B through GigabitEthernet 1/0/2.
Example: Configuring BFD for static routes (indirect next hop)
Network configuration
Figure 4 shows the network topology as follows:
· Device A has a route to interface Loopback 1 (2.2.2.9/32) on Device B, with the output interface GigabitEthernet 1/0/1.
· Device B has a route to interface Loopback 1 (1.1.1.9/32) on Device A, with the output interface GigabitEthernet 1/0/1.
· Device D has a route to 1.1.1.9/32, with the output interface GigabitEthernet 1/0/1, and a route to 2.2.2.9/32, with the output interface GigabitEthernet 1/0/2.
Configure the following:
· Configure a static route to subnet 120.1.1.0/24 on Device A.
· Configure a static route to subnet 121.1.1.0/24 on Device B.
· Enable BFD for both routes.
· Configure a static route to subnet 120.1.1.0/24 and a static route to subnet 121.1.1.0/24 on both Device C and Device D.
When the link between Device A and Device B through Device D fails, BFD can detect the failure immediately. Device A then communicates with Device B through Device C.
Table 2 Interface and IP address assignment
Device |
Interface |
IP address |
Device A |
GE1/0/1 |
12.1.1.1/24 |
Device A |
GE1/0/2 |
10.1.1.102/24 |
Device A |
Loopback 1 |
1.1.1.9/32 |
Device B |
GE1/0/1 |
11.1.1.2/24 |
Device B |
GE1/0/2 |
13.1.1.1/24 |
Device B |
Loopback 1 |
2.2.2.9/32 |
Device C |
GE1/0/1 |
10.1.1.100/24 |
Device C |
GE1/0/2 |
13.1.1.2/24 |
Device D |
GE1/0/1 |
12.1.1.2/24 |
Device D |
GE1/0/2 |
11.1.1.2/24 |
Procedure
1. Configure IP addresses for interfaces. (Details not shown.)
2. Configure static routes and BFD:
# Configure static routes on Device A and enable BFD control packet mode for the static route that traverses Device D.
<DeviceA> system-view
[DeviceA] bfd multi-hop min-transmit-interval 500
[DeviceA] bfd multi-hop min-receive-interval 500
[DeviceA] bfd multi-hop detect-multiplier 9
[DeviceA] ip route-static 120.1.1.0 24 2.2.2.9 bfd control-packet bfd-source 1.1.1.9
[DeviceA] ip route-static 120.1.1.0 24 gigabitethernet 1/0/2 10.1.1.100 preference 65
[DeviceA] quit
# Configure static routes on Device B and enable BFD control packet mode for the static route that traverses Device D.
<DeviceB> system-view
[DeviceB] bfd multi-hop min-transmit-interval 500
[DeviceB] bfd multi-hop min-receive-interval 500
[DeviceB] bfd multi-hop detect-multiplier 9
[DeviceB] ip route-static 121.1.1.0 24 1.1.1.9 bfd control-packet bfd-source 2.2.2.9
[DeviceB] ip route-static 121.1.1.0 24 gigabitethernet 1/0/2 13.1.1.2 preference 65
[DeviceB] quit
# Configure static routes on Device C.
<DeviceC> system-view
[DeviceC] ip route-static 120.1.1.0 24 13.1.1.1
[DeviceC] ip route-static 121.1.1.0 24 10.1.1.102
# Configure static routes on Device D.
<DeviceD> system-view
[DeviceD] ip route-static 120.1.1.0 24 11.1.1.2
[DeviceD] ip route-static 121.1.1.0 24 12.1.1.1
Verifying the configuration
# Display the BFD session information on Device A.
<DeviceA> display bfd session
Total sessions: 1 Up sessions: 1 Init mode: Active
IPv4 session working in control packet mode:
LD/RD SourceIP DestinationIP State Holdtime Interface
4/7 1.1.1.9 2.2.2.9 Up 2000ms N/A
The output shows that the BFD session has been created.
# Display static routes on Device A.
<DeviceA> display ip routing-table protocol static
Summary Count : 1
Static Routing table Status : <Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
120.1.1.0/24 Static 60 0 12.1.1.2 GE1/0/1
Static Routing table Status : <Inactive>
Summary Count : 0
The output shows that Device A communicates with Device B through GigabitEthernet 1/0/1. Then the link over GigabitEthernet 1/0/1 fails.
# Display static routes on Device A.
<DeviceA> display ip routing-table protocol static
Summary Count : 1
Static Routing table Status : <Active>
Summary Count : 1
Destination/Mask Proto Pre Cost NextHop Interface
120.1.1.0/24 Static 65 0 10.1.1.100 GE1/0/2
Static Routing table Status : <Inactive>
Summary Count : 0
The output shows that Device A communicates with Device B through GigabitEthernet 1/0/2.
Example: Configuring static route FRR
Network configuration
As shown in Figure 5, configure static routes on Device A, Device B, and Device C, and configure static route FRR. When Link A becomes unidirectional, traffic can be switched to Link B immediately.
Table 3 Interface and IP address assignment
Device |
Interface |
IP address |
Device A |
GE1/0/1 |
12.12.12.1/24 |
Device A |
GE1/0/2 |
13.13.13.1/24 |
Device A |
Loopback 0 |
1.1.1.1/32 |
Device B |
GE1/0/1 |
24.24.24.4/24 |
Device B |
GE1/0/2 |
13.13.13.2/24 |
Device B |
Loopback 0 |
4.4.4.4/32 |
Device C |
GE1/0/1 |
12.12.12.2/24 |
Device C |
GE1/0/2 |
24.24.24.2/24 |
Procedure
1. Configure IP addresses for interfaces. (Details not shown.)
2. Configure static route FRR on link A by using one of the following methods:
¡ (Method 1.) Specify a backup next hop for static route FRR:
# Configure a static route on Device A, and specify GigabitEthernet 1/0/1 as the backup output interface and 12.12.12.2 as the backup next hop.
<DeviceA> system-view
[DeviceA] ip route-static 4.4.4.4 32 gigabitethernet 1/0/2 13.13.13.2 backup-interface gigabitethernet 1/0/1 backup-nexthop 12.12.12.2
# Configure a static route on Device B, and specify GigabitEthernet 1/0/1 as the backup output interface and 24.24.24.2 as the backup next hop.
<DeviceB> system-view
[DeviceB] ip route-static 1.1.1.1 32 gigabitethernet 1/0/2 13.13.13.1 backup-interface gigabitethernet 1/0/1 backup-nexthop 24.24.24.2
¡ (Method 2.) Configure static route FRR to automatically select a backup next hop:
# Configure static routes on Device A, and enable static route FRR.
<DeviceA> system-view
[DeviceA] ip route-static 4.4.4.4 32 gigabitethernet 1/0/2 13.13.13.2
[DeviceA] ip route-static 4.4.4.4 32 gigabitethernet 1/0/1 12.12.12.2 preference 70
[DeviceA] ip route-static fast-reroute auto
# Configure static routes on Device B, and enable static route FRR.
<DeviceB> system-view
[DeviceB] ip route-static 1.1.1.1 32 gigabitethernet 1/0/2 13.13.13.1
[DeviceB] ip route-static 1.1.1.1 32 gigabitethernet 1/0/1 24.24.24.2 preference 70
[DeviceB] ip route-static fast-reroute auto
3. Configure static routes on Device C.
<DeviceC> system-view
[DeviceC] ip route-static 4.4.4.4 32 gigabitethernet 1/0/2 24.24.24.4
[DeviceC] ip route-static 1.1.1.1 32 gigabitethernet 1/0/1 12.12.12.1
Verifying the configuration
# Display route 4.4.4.4/32 on Device A to view the backup next hop information.
[DeviceA] display ip routing-table 4.4.4.4 verbose
Summary Count : 1
Destination: 4.4.4.4/32
Protocol: Static
Process ID: 0
SubProtID: 0x0 Age: 04h20m37s
Cost: 0 Preference: 60
IpPre: N/A QosLocalID: N/A
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NibID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x1008c OrigNextHop: 13.13.13.2
Label: NULL RealNextHop: 13.13.13.2
BkLabel: NULL BkNextHop: 12.12.12.2
SRLabel: NULL BkSRLabel: NULL
SIDIndex: NULL InLabel: NULL
Tunnel ID: Invalid Interface: GigabitEthernet1/0/2
BkTunnel ID: Invalid BkInterface: GigabitEthernet1/0/1
FtnIndex: 0x0 TrafficIndex: N/A
Connector: N/A
# Display route 1.1.1.1/32 on Device B to view the backup next hop information.
[DeviceB] display ip routing-table 1.1.1.1 verbose
Summary Count : 1
Destination: 1.1.1.1/32
Protocol: Static
Process ID: 0
SubProtID: 0x0 Age: 04h20m37s
Cost: 0 Preference: 10
IpPre: N/A QosLocalID: N/A
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 0
NibID: 0x26000002 LastAs: 0
AttrID: 0xffffffff Neighbor: 0.0.0.0
Flags: 0x1008c OrigNextHop: 13.13.13.1
Label: NULL RealNextHop: 13.13.13.1
BkLabel: NULL BkNextHop: 24.24.24.2
SRLabel: NULL BkSRLabel: NULL
SIDIndex: NULL InLabel: NULL
Tunnel ID: Invalid Interface: GigabitEthernet1/0/2
BkTunnel ID: Invalid BkInterface: GigabitEthernet1/0/1
FtnIndex: 0x0 TrafficIndex: N/A
Connector: N/A
Configuring a default route
A default route is used to forward packets that do not match any specific routing entry in the routing table. Without a default route, packets that do not match any routing entries are discarded and an ICMP destination-unreachable packet is sent to the source.
A default route can be configured in either of the following ways:
· The network administrator can configure a default route with both destination and mask being 0.0.0.0. For more information, see "Configuring static routing."
· Some dynamic routing protocols (such as OSPF, IS-IS, and RIP) can generate a default route. For example, an upstream router running OSPF can generate a default route and advertise it to other routers. These routers install the default route with the next hop being the upstream router. For more information, see the respective chapters on these routing protocols in this configuration guide.