The term router
in this chapter refers to a router in a generic sense or an Ethernet switch
running a routing protocol.
Syntax
display ip routing-table [ | { begin | exclude | include } regular-expression
]
View
Any view
Parameters
regular-expression: Regular expression, a string of 1 to 256 case-sensitive
characters used for specifying routing entries.
|: Uses the regular expression to match the
output routing information.
begin:
Displays the routing information from the route entry containing the specified
character string.
include: Displays all routing information containing the specified
character string.
exclude: Displays all routing information without the specified character
string.
For details about
regular expressions, refer to Configuration File Management Operation
of this manual.
Description
Use the display ip routing-table
command to display the routing table summary.
This command displays the summary of the
routing table. Each line represents one route, containing destination
address/mask length, protocol, preference, cost, next hop, and output
interface.
This command displays only the currently
used routes, that is, the optimal routes.
Examples
# Display the
summary of the current routing table.
<Sysname> display ip routing-table
Routing
Table: public net
Destination/Mask Protocol Pre
Cost Nexthop Interface
1.1.1.0/24 DIRECT 0 0 1.1.1.1 Vlan-interface1
1.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
2.2.2.0/24 DIRECT 0 0 2.2.2.1 Vlan-interface2
2.2.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
3.3.3.0/24 DIRECT 0 0 3.3.3.1 Vlan-interface3
3.3.3.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
4.4.4.0/24 DIRECT 0 0 4.4.4.1 Vlan-interface4
4.4.4.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0
127.0.0.1 InLoopBack0
# Display the routing information from the entry
containing the character string interface4in the current routing table.
<Sysname> display ip
routing-table | begin interface4
Routing Table: public net
4.4.4.0/24 DIRECT 0 0 4.4.4.1 Vlan-interface4
4.4.4.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
# Display the routing information containing
the character string interface4 in the current routing table.
<Sysname> display ip
routing-table | include interface4
Routing Table: public net
Destination/Mask Protocol Pre
Cost Nexthop Interface
4.4.4.0/24 DIRECT 0 0 4.4.4.1 Vlan-interface4
# Display the routing information without
the character string interface4in the current routing table.
<Sysname> display ip
routing-table | exclude interface4
Routing Table: public net
Destination/Mask Protocol Pre
Cost Nexthop Interface
1.1.1.0/24 DIRECT 0 0 1.1.1.1 Vlan-interface1
1.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
2.2.2.0/24 DIRECT 0 0 2.2.2.1 Vlan-interface2
2.2.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
3.3.3.0/24 DIRECT 0 0 3.3.3.1 Vlan-interface3
3.3.3.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
4.4.4.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
Table 1-1 Description
on the fields of the display ip routing-table command
|
Field
|
Description
|
|
Destination/Mask
|
Destination address/mask length
|
|
Protocol
|
Routing protocol
|
|
Pre
|
Route preference
|
|
Cost
|
Route cost
|
|
Nexthop
|
Next hop address
|
|
Interface
|
Output interface, through which the data
packets destined for the destination network segment are sent
|
Syntax
display ip routing-table acl acl-number [ verbose ]
View
Any view
Parameters
acl-number: Basic
access control list number, in the range of 2000 to 2999.
verbose:
With this keyword specified, detailed information of routes in the active or
inactive state that match the ACL is displayed. With this keyword not
specified, brief information of only the routes in the active state that match
the ACL is displayed.
Description
Use the display ip routing-table acl
command to display the information of routes that match the specified ACL.
Examples
# Display the information of ACL 2100.
<Sysname> display acl 2100
Basic ACL 2100, 1 rule
Acl's step is 1
rule 0 permit source 192.168.1.0
0.0.0.255
For details about the display acl command,
refer to ACL Command.
# Display the information of routes that
match ACL 2100.
<Sysname> display ip
routing-table acl 2100
Routes matched by access-list
2100:
Summary count: 2
Destination/Mask Protocol Pre
Cost Nexthop Interface
192.168.1.0/24 DIRECT 0
0 192.168.1.2 Vlan-interface2
192.168.1.2/32 DIRECT 0
0 127.0.0.1 InLoopBack0
For descriptions of the above fields, refer
to Table 1-1.
# Display the detailed information of
routes that match ACL 2100.
<Sysname> display ip
routing-table acl 2100 verbose
Routes matched by access-list
2100:
+ = Active Route, - = Last
Active, # = Both * = Next hop in use
Summary count: 3
**Destination: 192.168.1.0
Mask: 255.255.255.0
Protocol: #DIRECT
Preference: 0
*NextHop:
192.168.1.2 Interface: 192.168.1.2(Vlan-interface2)
State: <Int ActiveU
Retain Unicast>
Age: 21:34:13 Cost:
0/0
**Destination: 192.168.1.2
Mask: 255.255.255.255
Protocol: #DIRECT
Preference: 0
*NextHop:
127.0.0.1 Interface: 127.0.0.1(InLoopBack0)
State: <NoAdvise Int
ActiveU Retain Gateway Unicast>
Age: 21:34:13 Cost:
0/0
Table 1-2 Description
on the fields of the display ip routing-table command
|
Field
|
Description
|
|
Destination
|
Destination address
|
|
Mask
|
Subnet mask
|
|
Protocol
|
Protocol that discovers the route
|
|
Preference
|
Route preference
|
|
Nexthop
|
Next hop to the destination
|
|
Interface
|
Outbound interface through which
data packets are forwarded to the destination network segment.
|
|
State
|
Description
of route state:
|
|
ActiveU
|
An active unicast route, where
“U” represents unicast.
|
|
Blackhole
|
A blackhole route is similar to a
reject route, but no ICMP unreachable message is sent to the source.
|
|
Delete
|
A route is to be deleted.
|
|
Gateway
|
An indirect route.
|
|
Hidden
|
An existing route that is
temporarily unavailable for some reason (for example, suppressed by a routing
policy or down interface). However, deletion is not expected. It is therefore
hidden so that it can recover later.
|
|
Holddown
|
Number of routes that are held
down. Holddown is a route advertisement policy that some D-V based routing
protocols (for example, RIP) use to avoid the spread of wrong routes but
speed up the correct spread of ICMP unreachable messages. A certain route is
advertised at intervals, no matter whether the currently discovered route to
the same destination changes. For details, refer to the specific routing
protocols.
|
|
Int
|
A route discovered by IGP.
|
|
NoAdvise
|
A routing protocol does not advertise any
NoAdvise route when advertising routes in accordance with a routing policy.
|
|
NotInstall
|
A NonInstall route cannot be added
to the core routing table, but may be advertised. A route with the highest
priority is generally selected from the routing table, added to the core
routing table, and then advertised.
|
|
Reject
|
The routes marked with reject do
not guide the router to forward packets as a normal route does. The router
discards the packets matching reject routes and sends an ICMP unreachable
message to the source.
Reject routes are usually used
for network tests.
|
|
Retain
|
The routes marked with retain
will not be deleted when you delete routes in the core routing table. You can
mark static routes with retain to make them stay in the core routing
table.
|
|
Static
|
The routes marked with static
will not be deleted from the routing table after you perform a save operation
and restart the router. The routes manually configured on a router are marked
with static.
|
|
Unicast
|
A unicast route.
|
|
Age
|
Lifetime
of a route in the routing table, in the format of HH:MM:SS.
|
|
Cost
|
Cost of a route.
|
Syntax
display ip routing-table ip-address [ mask | mask-length ] [ longer-match
] [ verbose ]
View
Any view
Parameters
ip-address:
Destination IP address, in dotted decimal notation.
mask: Subnet
mask, in dotted decimal notation.
mask-length:
Length of a subnet mask, in the range of 0 to 32.
longer-match:
Specifies all the routes that lead to the destination address and match the
specified mask. If you do not specify the mask argument, those that
match the natural mask are specified.
verbose: Displays
the detailed information of routes.
Description
Use the display ip routing-table ip-address
command to display the routing information of the specified destination
address.
With different arguments provided, the
command output is different. The following is the command output with different
arguments provided:
l
display ip routing-table ip-address
If the destination address ip-address
corresponds to a route in the natural mask range, this command displays the
route that is the longest match of the destination address ip-address
and is active.