The term
“router” in this document refers to a router in a generic sense or
an Ethernet switch running a routing protocol.
Syntax
display ip routing-table
View
Any view
Parameter
None
Description
Use the display ip routing-table
command to display the summary of a routing table.
This command is used to display the summary
of a routing table. Each line represents one route, containing the destination
address/mask length, protocol, preference, cost, next hop, and output interface.
This command is only used to display the
currently used routes, that is, the optimal routes.
Example
# Display the
summary of the current routing table.
<H3C> 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
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 sent to the destination network segment are sent
|
Syntax
display ip routing-table acl { acl-number | acl-name } [ verbose ]
View
Any view
Parameter
acl-number:
Number of the number-identified ACL, in the range 2,000 to 2,999.
acl-name:
Name of the basic name-identified ACL.
verbose:
Specifies to display the detailed information about active and inactive routes
filtered through the ACL rules if this keyword is provided; specifies to
display the brief information about the active routes filtered through the ACL
rules.
Description
Use the display ip routing-table acl
command to display the routes filtering through the basic ACL rules.
This command is used to trace and display
routing policies, that is, to display the routes filtering through the rules
based on the input basic ACL numbers.
Example
# Display the brief information about the
active routes filtering through basic ACL 2000.
<H3C>system-view
System View: return to User View with
Ctrl+Z.
[H3C] acl number 2000
[H3C-acl-basic-2000] rule permit
source 10.1.1.1 0.0.0.255
[H3C-acl-basic-2000] rule deny source
any
[H3C-acl-basic-2000] display ip
routing-table acl 2000
Routes matched by access-list 2000:
 Summary count: 2
Destination/Mask  Protocol PreÂ
Cost       Nexthop      Interface
10.1.1.0/24Â DIRECTÂ 0Â Â 0Â Â 10.1.1.2Â Â Â Â Â Â Â
Vlan-interface1
10.1.1.2/32Â DIRECTÂ 0Â Â 0Â Â 127.0.0.1Â Â Â Â Â
InLoopBack0
Refer to Table 1-1 for the description on the
displayed information above.
# Display the detailed information about
the active and inactive routes filtered through basic ACL 2000.
<H3C> display ip routing-table
acl 2000 verbose
Routes matched by access-list 2000:
Generate Default: no
 + = Active Route, - = Last Active,
# = Both  * = Next hop in use
 Summary count: 2
**Destination: 10.1.1.0Â Â Â Â Â Â Â Â Mask:
255.255.255.0
       Protocol: #DIRECT     Â
Preference: 0
       *NextHop: 10.1.1.2       Â
Interface: 10.1.1.2(Vlan-interface1)
       Vlinkindex: 0
       State: <Int ActiveU Retain
Unicast>
       Age: 7:24      Cost:
0/0Â Â Â Â Â Â Tag: 0
**Destination: 10.1.1.2Â Â Â Â Â Â Â Â Mask:
255.255.255.255
       Protocol: #DIRECT     Â
Preference: 0
       *NextHop: 127.0.0.1      Â
Interface: 127.0.0.1(InLoopBack0)
       Vlinkindex: 0
       State: <NoAdvise Int
ActiveU Retain Gateway Unicast>
       Age: 7:24      Cost:
0/0Â Â Â Â Â Â Tag: 0
Table 1-2 Description on the fields of
the display ip routing-table acl command
|
Field
|
Description
|
|
Destination
|
Destination
address
|
|
Mask
|
Mask
|
|
Protocol
|
Routing
protocol that detects this route
|
|
Preference
|
Preference
of the route
|
|
Nexthop
|
Address of
the next hop
|
|
Interface
|
Output
interface where packets to the destination network segment are forwarded.
|
|
Vlinkindex
|
Virtual
link index
|
|
State
|
Route
state:
|
|
ActiveU
|
Active
unicast routes
|
|
Blackhole
|
Blackhole routes,
which are similar to Reject routes except that blackhole routes do not send
ICMP unreachable messages to the source end of the packet.
|
|
Delete
|
The route
is deleted.
|
|
Gateway
|
Indirect
routes
|
|
Hidden
|
If you do
not want to remove some routes that are not available temporarily for some
reasons (such as the configured polices, the port being down), you can hide
the route so as to restore it later.
|
|
Holddown
|
Holddown
is a route redistribution policy adopted by some distance-vector (D-V)
routing protocols such as RIP. Through Holddown, a routing protocol can avoid
the flooding of error routes and deliver route unreachable messages
accurately. It redistributes a certain route at regular intervals regardless of
whether the actually found routes leading to the same destination change. For
more details, refer to the specific routing protocols.
|
|
Int
|
The route
is discovered by the interior gateway protocol (IGP).
|
|
NoAdvise
|
NoAdvise routes
are nor advertised when the routing protocol ad
|
|
NotInstall
|
Generally,
the route with the highest preference in a routing table is added to the core
routing table and advertised. Comparatively, NotInstall routes cannot be added
to the core routing table, however, they may be advertised.
|
|
Reject
|
Reject
routes do not distribute packets like normal routes. Instead, the packet that
selects a reject route will be dropped, and ICMP unreachable messages will be
sent to the source end of the packet. Reject routes are generally used in
network tests.
|
|
Retain
|
When the
routes read by the core routing table are removed, the routes with the
“retain” tag will not be removed. You can set some static routes as
retain routes so that they can continue to exist in the core routing table.
|
|
Static
|
The static
routes manually configured on the router are tagged as static routes, which
will not be removed from the routing table if the router is restarted after the
save command is executed.
|
|
Unicast
|
Unicast
routes
|
|
Age
|
The time
during which a route exists in the routing table, expressed in the form of
hh:mm:ss.
|
|
Cost
|
Route cost
|
|
Tag
|
Route tag
|
Syntax
display ip routing-table ip-address [ mask ] [ longer-match ] [ verbose
]
View
Any view
Parameter
ip-address:
Destination IP address, in dotted decimal notation.
mask: IP
address mask, length in dotted decimal notation or expressed as an integer. It
ranges from 0 to 32 when expressed as an integer.
longer-match:
Specifies to display 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 will be displayed.
verbose: With
the verbose argument specified, this command is used to display the
verbose information of both active and inactive routes. Without the argument
specified, this command is only used to display the summary of active 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
output information is different from one another. The following is the command
output with different arguments provided:
l
display ip routing-table ip-address
If the destination address specified by ip-address
corresponds to a route in the natural mask range, this command is used to
display all its subnet routes. Otherwise, this command is used to display the
longest matching route based on the destination address specified by ip-address.
l
display ip routing-table ip-address mask
This command is only used to display the
routes exactly matching the specified destination address and mask.
l
display ip routing-table ip-address longer-match
This command is used to display all the
matched routes leading to the destination address in the natural mask range.
l
display ip routing-table ip-address mask longer-match
This command is used to display all the
matched routes leading to the destination address in the specified mask range.
Example
# There is a
corresponding route in the natural mask range. Display the summary.
<H3C> display ip routing-table
169.0.0.0
Destination/Mask    Protocol   Pre Cost
  Nexthop    Interface
169.0.0.0/16        Static 60 0      2.1.1.1    LoopBack1
For detailed description of the output
information, refer to Table
1-1.
# There is no
corresponding route (only the longest matched route is displayed) in the
natural mask range. Display the summary.
<H3C> display ip routing-table
169.253.0.0
Destination/Mask    Protocol   Pre    Cost
  Nexthop    Interface
169.0.0.0/8         Static 60     0      2.1.1.1    LoopBack1
# There are corresponding routes in the
natural mask range. Display detailed information.
<H3C> display ip routing-table
169.0.0.0 verbose
Routing Tables:
 Generate Default: no
 + = Active Route, - = Last Active,
# = Both   * = Next hop in use
  Summary count:2
**Destination: 169.0.0.0Â Â Â Â Mask:
255.0.0.0
       Protocol: #Static       Preference:
60
       *NextHop: 2.1.1.1        Â
Interface: 2.1.1.1(LoopBack1)
       Vlinkindex: 0
       State: <Int ActiveU Static
Unicast>
       Age: 3:47   Cost: 0/0  Tag:
0
**Destination: 169.0.0.0Â Â Â Â Mask:
255.254.0.0
       Protocol: #Static       Preference:
60
       *NextHop: 2.1.1.1        Â
Interface: 2.1.1.1(LoopBack1)
       Vlinkindex: 0
       State: <Int ActiveU Static
Unicast>
       Age: 3:47   Cost: 0/0  Tag:
0
# There is no corresponding route in the
natural mask range (only the longest matched route is displayed). Display the
detailed information.
<H3C> display ip routing-table
169.253.0.0 verbose
Routing Tables:
 Generate Default: no
 + = Active Route, - = Last Active,
# = Both   * = Next hop in use
 Summary count:1
**Destination: 169.0.0.0Â Â Â Â Mask:
255.0.0.0
       Protocol: #Static       Preference:
60
       *NextHop: 2.1.1.1        Â
Interface: 2.1.1.1(LoopBack1)
       Vlinkindex: 0
       State: <Int ActiveU Static
Unicast>
       Age: 3:47   Cost: 0/0  Tag:
0
For detailed description of the output
information, refer to Table
1-2.
Syntax
display ip routing-table ip-address1 mask1 ip-address2 mask2 [ verbose
]
View
Any view
Parameter
ip-address1, ip-address2: Destination IP address in dotted decimal notation. ip-address1,
mask1 and ip-address2, mask2 determine one address range together. ip-address1
ANDed with mask1 specifies the start of the range, and
ip-address2 ANDed with mask2 specifies the end of the range.
This command is used to display the route in this address range.
mask1, mask2:
IP address mask, length in dotted decimal notation or expressed as an integer.
It ranges from 0 to 32 when expressed as an integer.
verbose: With
the verbose argument provided, this command is used to display the
verbose information of both active and inactive routes. Without this argument
provided, this command is used to display the summary of active routes only.
Description
Use the display ip routing-table ip-address1
ip-address2 command to display the route information in the specified
destination address range.
Example
# Display the routing information of
destination addresses ranging from 1.1.1.0 to 2.2.2.0.
<H3C>display ip routing-table
1.1.1.0 24 2.2.2.0 24
Routing tables:
 Summary count: 3
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
For detailed description of the output
information, refer to Table
1-1.
Syntax
display ip routing-table ip-prefix ip-prefix-name [ verbose ]
View
Any view
Parameter
ip-prefix-name: Name of the IP address prefix list, containing 1 to 19 characters.
verbose:
Specifies to display the detailed information about active and inactive routes
filtered through the ACL rules if this keyword is provided; specifies to
display the brief information about the active routes filtered through the ACL
rules.
Description
Use the display ip routing-table
ip-prefix command to display the routes filtered through the specified
ip-prefix list.
This command is used to track and display
the routing policy. It is used to display the routes filtering through the
rules based on the input ip-prefix list name.
If the specified ip-prefix list does not
exist, with the verbose keyword provided, this command is used to
display the detailed information about all active and inactive routes; without
the verbose argument keyword, this command is used to display the brief
information about all active routes only.
Example
# Display the brief information about the
active routes filtered through the IP-prefix list named abc2, which permits the
route with a prefix of 10.1.1.0 and a mask length of 24 to 32.
<H3C>system-view
System View: return to User View with
Ctrl+Z.
[H3C] ip ip-prefix abc2 permit
10.1.1.0 24 less-equal 32
[H3C] display ip routing-table
ip-prefix abc2
Routes matched by ip-prefix abc2:
 Summary count: 2
Destination/Mask  Protocol PreÂ
Cost      Nexthop        Interface
10.1.1.0/24Â Â Â Â Â Â Â Â DIRECTÂ Â Â 0Â Â