display ip routing-table ip-address
Syntax
display ip routing-table ip-address [ mask | mask-length ] [ longer-match ] [ verbose ] [ | { begin | exclude | include } regular-expression ]
display ip routing-table ip-address1 { mask | mask-length } ip-address2 { mask | mask-length } [ verbose ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
ip-address: Destination IP address, in dotted decimal format.
mask | mask-length: IP address mask, in dotted decimal format or represented by an integer in the range 0 to 32.
longer-match: Displays the route with the longest mask.
verbose: Displays detailed routing table information, including both active and inactive routes. With this argument absent, the command displays only brief information about active routes.
|: Filters command output by specifying a regular expression. For more information about regular expressions, see the Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, which is a case sensitive string of 1 to 256 characters.
Description
Use the display ip routing-table ip-address command to display information about routes to a specified destination address.
Executing the command with different parameters yields different output:
display ip routing-table ip-address
The system ANDs the input destination IP address with the subnet mask in each route entry; and ANDs the destination IP address in each route entry with its own subnet mask.
If the two operations yield the same result for an entry and this entry is active, it is displayed.
display ip routing-table ip-address mask
The system ANDs the input destination IP address with the input subnet mask; and ANDs the destination IP address in each route entry with the input subnet mask.
If the two operations yield the same result for an entry and the entry is active with a subnet mask less than or equal to the input subnet mask, the entry is displayed.
Only route entries that exactly match the input destination address and mask are displayed.
display ip routing-table ip-address longer-match
The system ANDs the input destination IP address with the subnet mask in each route entry; and ANDs the destination IP address in each route entry with its own subnet mask.
If the two operations yield the same result for multiple entries that are active, the one with longest mask length is displayed.
display ip routing-table ip-address mask longer-match
The system ANDs the input destination IP address with the input subnet mask; and ANDs the destination IP address in each route entry with the input subnet mask.
If the two operations yield the same result for multiple entries with a mask less than or equal to the input subnet mask, the one that is active with longest mask length is displayed.
Use the display ip routing-table ip-address1 { mask-length | mask } ip-address2 { mask-length | mask } command to display route entries with destination addresses within a specified range.
Examples
# Display route entries for the destination IP address 11.1.1.1.
[Sysname] display ip routing-table 11.1.1.1 Routing Table : Public Summary Count : 4 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/0 Static 60 0 0.0.0.0 NULL0 11.0.0.0/8 Static 60 0 0.0.0.0 NULL0 11.1.0.0/16 Static 60 0 0.0.0.0 NULL0 11.1.1.0/24 Static 60 0 0.0.0.0 NULL0
For detailed description of the output, see Table 2.
# Display route entries by specifying a destination IP address and the longer-match keyword.
[Sysname] display ip routing-table 11.1.1.1 longer-match Routing Table : Public Summary Count : 1 Destination/Mask Proto Pre Cost NextHop Interface 11.1.1.0/24 Static 60 0 0.0.0.0 NULL0
# Display route entries by specifying a destination IP address and mask.
[Sysname] display ip routing-table 11.1.1.1 24 Routing Table : Public Summary Count : 3 Destination/Mask Proto Pre Cost NextHop Interface 11.0.0.0/8 Static 60 0 0.0.0.0 NULL0 11.1.0.0/16 Static 60 0 0.0.0.0 NULL0 11.1.1.0/24 Static 60 0 0.0.0.0 NULL0
# Display route entries by specifying a destination IP address and mask and the longer-match keyword.
[Sysname] display ip routing-table 11.1.1.1 24 longer-match Routing Table : Public Summary Count : 1 Destination/Mask Proto Pre Cost NextHop Interface 11.1.1.0/24 Static 60 0 0.0.0.0 NULL0
For detailed description of the output, see Table 2.
# Display route entries for destination addresses in the range 1.1.1.0 to 5.5.5.0.
<Sysname> display ip routing-table 1.1.1.0 24 5.5.5.0 24 Routing Table : Public Destination/Mask Proto Pre Cost NextHop Interface 1.1.1.0/24 Direct 0 0 1.1.1.1 Vlan1 1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 2.2.2.0/24 Direct 0 0 2.2.2.1 Vlan2 3.3.3.0/24 Direct 0 0 3.3.3.1 Vlan2 3.3.3.1/32 Direct 0 0 127.0.0.1 InLoop0 4.4.4.0/24 Direct 0 0 4.4.4.1 Vlan1 4.4.4.1/32 Direct 0 0 127.0.0.1 InLoop0