6
Displaying and maintaining static routes
To do…
Use the command…
Remarks
Display information of static routes
display ip routing-table
protocol
static
[
inactive
|
verbose
] [
|
{
begin
|
exclude
|
include
}
regular-expression
]
Available in any
view
Delete all the static routes
delete static-routes all
Available in
system view
NOTE:
For more information about the
display ip routing-table protocol static
[
inactive
|
verbose
] [
|
{
begin
|
exclude
|
include
}
regular-expression ] command, see Layer 3—IP Routing Command Reference.
Static route configuration examples
Basic static route configuration example
Network requirements
The IP addresses and masks of the switches and hosts are shown in
. Static routes are required for
interconnection between any two hosts.
Figure 1
Network diagram
Configuration procedure
1.
Configure IP addresses for interfaces. (Details not shown)
2.
Configure static routes.
# Configure a default route on Switch A.
<SwitchA> system-view
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
# Configure two static routes on Switch B.
<SwitchB> system-view
[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.4.1