- Table of Contents
-
- 04-Network Connectivity Configuration Guide
- 00-Preface
- 01-About the network connectivity configuration guide
- 02-MAC address table configuration
- 03-Ethernet link aggregation configuration
- 04-Port isolation configuration
- 05-VLAN configuration
- 06-Loop detection configuration
- 07-Spanning tree configuration
- 08-LLDP configuration
- 09-Layer 2 forwarding configuration
- 10-PPP configuration
- 11-ARP configuration
- 12-IP addressing configuration
- 13-DHCP configuration
- 14-DHCPv6 configuration
- 15-DNS configuration
- 16-NAT configuration
- 17-IP performance optimization configuration
- 18-IPv6 basics configuration
- 19-Static routing configuration
- 20-IPv6 static routing configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
19-Static routing configuration | 70.16 KB |
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.
ip route-static dest-address { mask-length | mask } { interface-type interface-number | next-hop-address } [ preference preference ]
By default, no static route is configured.
Configuring a floating static route
Perform this task to implement route backup and improve network reliability.
When a static or dynamic route to a destination address already exists on the device, you can configure another static route with a lower priority as the backup route to improve the network reliability. This backup static route is called a floating static route, and it is activated only when the primary route fails. After the primary route recovers from failure, the floating static route becomes inactive, and data forwarding switches back to the primary route.
You can configure a floating static route in either of the following ways:
· Configure different priorities for multiple static routes to the same destination address. The route with lower priority automatically becomes the floating static route.
· When a route to a destination address already exists on the device, configure a static route with a lower priority to the same destination address.
When you configure a floating static route, the priority value of the route must be larger than the priority value of the primary route. For more information, see "Configuring a static route."
Display and maintenance commands for static routing
Execute display commands in any view.
Task |
Command |
Display routing table information. |
display ip routing-table [ verbose ] |
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.
To configure a default route, configure a static route with both destination and mask being 0.0.0.0. For more information, see "Configuring static routing."
As shown in Figure 1, Device B is the next hop for packets from Device A to Device C, Device D, and Device E. You can configure a default route on Device A to replace the three static routes from Device A to Device C, Device D, and Device E. Then, packets that do not match any other routes will be forwarded based on the default route.
Configure the default route as follows:
· Configure the next hop address as 1.1.1.2.
· Configure the destination address as 0.0.0.0.
· Configure the subnet mask as 0.0.0.0.
Figure 1 Configuring a default route