- Table of Contents
-
- 04-Network Connectivity
- 00-Preface
- 01-About the network connectivity configuration guide
- 02-MAC address table configuration
- 03-Ethernet link aggregation configuration
- 04-VLAN configuration
- 05-Loop detection configuration
- 06-Spanning tree configuration
- 07-LLDP configuration
- 08-Layer 2 forwarding configuration
- 09-Port isolation 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-Basic IP routing configuration
- 20-Static routing configuration
- 21-IPv6 static routing configuration
- 22-Multicast overview
- 23-IGMP snooping configuration
- 24-MLD snooping configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
20-Static routing configuration | 50.48 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 ] | next-hop-address } [ permanent ] [ tag tag-value ] [ description text ]
By default, no static route is configured.
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.
ip route-static group group-name { interface-type interface-number [ next-hop-address ] | next-hop-address } [ permanent ] [ tag tag-value ] [ description text ]
By default, no static route is configured.
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.
delete static-routes all
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 [ ip-address { mask-length | mask } ] |
For more information about the display ip routing-table protocol static [ inactive | verbose ] command, see basic IP routing in Network Connectivity Command Reference.
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."