The term router in this chapter refers to a router in a generic sense or an Ethernet
switch running a routing protocol.
1.1 IP Routing Table Commands
1.1.1 display ip routing-table
Syntax
Chapter 1 IP Routing Table
Commands
View
Parameters
display ip routing-table [ | { begin | exclude | include } regular-expression ]
Any view
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.
Note:
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 summa ry.
This command displays the summary of the routing table. Each line represents one
route, containing destination address/mask length, pro tocol, 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
Chapter 1 IP Routing Table
Commands
# Display the routing information from the entry containing the character string
interface4 in 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 interface4 in the current
routing table.
<Sysname> display ip routing-table | exclude interface4
Routing Table: public net
Destination/Mask Protocol Pre Cost Nexthop Interface
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
Chapter 1 IP Routing Table
Commands
Interface
Output interface, through which the data packets destined
for the destination network segment are sent
1.1.2 display ip routing-table acl
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
Examples
Use the display ip routing-table acl command to display the information of routes that
match the specified ACL.
# Display the summary information about the active routes that match ACL 2000.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] acl number 2000
[Sysname-acl-basic-2000] rule permit source 10.1.1.1 0.0.0.255
[Sysname-acl-basic-2000] rule deny source any
[Sysname-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 or the description on the output fields.
# Display the detailed information about the active and inactive routes that match ACL
2000.
<Sysname> display ip routing-table acl 2000 verbose
Routes matched by access-list 2000:
+ = Active Route, - = Last Active, # = Both * = Next hop in use
Destinations: 2 Routes: 2
Holddown: 0 Delete: 0 Hidden: 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 p ackets are forwarded to the
destination network segment.
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.
Chapter 1 IP Routing Table
Commands
Description
verbose: Displays the detailed information of routes.
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 o utput is different. The following is the
command output with different arguments provided:
zdisplay ip routing-tableip-address
If the destination address ip-address corresponds to a route in the natural m ask range,
this command displays the route that is the longest match of the destination address
ip-address and is active.
z display ip routing-tableip-addressmask
This command only displays the routes exactly matching the specified destination
address and mask.
zdisplay ip routing-tableip-addresslonger-match
This command displays all destination address routes matching the specified
destination address in the natural mask range.
Examples
zdisplay ip routing-table ip-address masklonger-match
This command displays all destination address routes matching the specified
destination address in the specified mask range.
# Display the brief information of routes with a natural mask.
ip-address1, ip-address2: Destination IP address in dotted decimal notation.
ip-address1 {mask1 | mask-length1} and ip-address2 {mask2 | mask-length2} determine one address range together. ip-address1 ANDedwith {mask1 |
mask-length1} specifies the start of the range, while ip-address2 ANDedwith {mask2 |
mask-length2} specifies the end. This command displays the route in this address
range.
mask1, mask2: Subnet mask, in dotted decimal notation.
mask-length1, mask-length2: Mask length, in the ranges of 0 to 32.
Description
verbose: With the verbose argument provided, this command displays the verbose
information of both active and inactive routes. Without this argument provided, this
command displays the summary of active routes only.
Use the display ip routing-table ip-address1 ip-address2 command to display the
route information in the specified destination address range.
# Display the routing information of destination addresses ranging from 1.1.1.0 to
2.2.2.0.
<Sysname>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 descriptions of the above fields, see Table 1-1.
1.1.5 display ip routing-table protocol
Syntax
display ip routing-table protocol protocol [ inactive | verbose ]
Chapter 1 IP Routing Table
Commands
View
Parameters
Description
Any view
protocol: You can provide one of the following values for this argument.
z direct: Displa ys direct-connect route information
z static: Displays static route information.
inactive: With this argument provided, this command displays the inactive route
information. Without this argument provided, this command displays both active and
inactive route information.
verbose: With this keyword specified, detailed information of routes in the active or
inactive state is displayed. With this keyword not specified, brief information of only the
routes in the active state is displayed.
Use the display ip routing-table protocol command to display the route information
of a specific protocol.
Examples
# Display the summary of all direct-connect routes.
<Sysname> display ip routing-table protocol direct
DIRECT Routing tables:
Summary count: 4
Table 1-3 Description on the fields of the display ip routing-table radix command
Field Description
INET Address suite
Inodes Number of nodes
Routes Number of routes
1.1.7 display ip routing-table statistics
Syntax
display ip routing-table statistics
View
Any view
Parameters
Chapter 1 IP Routing Table
Commands
Description
Examples
None
Use the display ip routing-table statistics comm and to display the integrated routing
information.
The integrated routing information includes the total number of routes, the number of
active routes, the number of routes added by protocols, and the number of routes
deleted.
# Display the integrated route information.
<Sysname> display ip routing-table statistics
Routing tables:
Proto route active added deleted
DIRECT 24 4 25 1
STATIC 4 1 4 0
Total 28 5 29 1
Table 1-4 Description on the fields of the display ip routing-table statistics
command
Field Description
Proto Routing protocol type
Route Total number of routes
Number of routes added after the router is rebooted or the
routing table is cleared last time.
Number of routes deleted (Such routes will be freed in a
period of time)
Total Total number of the different kinds of routes
1.1.8 display ip routing-table verbose
Syntax
display ip routing-table verbose
View
Any view
Parameters
None
Description
Examples
Use the display ip routing-table verbose command to display the detailed
information of a routing table, including inactive ro utes and null route s. The information
displayed includes route state descriptor, statistics of the routing table, and detailed
information of each route.
# Display the verbose routing table information.
<Sysname> display ip routing-table verbose
Routing Tables:
+ = Active Route, - = Last Active, # = Both * = Next hop in use
Destinations: 3 Routes: 3
Holddown: 0 Delete: 62 Hidden: 0
**Destination: 1.1.1.0 Mask: 255.255.255.0
Protocol: #DIRECT Preference: 0
*NextHop: 1.1.1.1 Interface: 1.1.1.1(Vlan-interface1)
State: <Int ActiveU Retain Unicast>
Age: 20:17:41 Cost: 0/0
**Destination: 1.1.1.1 Mask: 255.255.255.255
Protocol: #DIRECT Preference: 0
*NextHop: 127.0.0.1 Interface: 127.0.0.1(InLoopBack0)
Table 1-5 lists the statistics of the routing table.
Table 1-5 Description on the fields of the display ip routing-table verbose command
Holddown Number of suppressed routes
Delete Number of deleted routes
Hidden Number of hidden routes
Chapter 1 IP Routing Table
Commands
Field Description
1.1.9 reset ip routing-table statistics protocol
Syntax
reset ip routing-table statistics protocol { all | protocol }
View
User view
Parameters
all: Specifies all protocol s. protocol: Specifies a proto col, which can be direct, or static.
Description
Use the reset ip routing-table statistics protocol command to clear the statistics of
routes in a routing table.
Examples
# Before executing the reset ip routing-table statistics protocol command, use the
display ip routing-table statis tics com mand to display the routing statistics:
<Sysname> display ip routing-table statistics
Routing tables:
Proto route active added deleted
DIRECT 4 4 12 8
The term router in this chapter refers to a router in a generic sense or an Ethernet
switch running a routing protocol.
2.1 Static Route Configuration Commands
2.1.1 delete static-routes all
Syntax
View
Parameters
Description
Examples
delete static-routes all
System view
None
Use the delete static-routes all command to delete all static route s.
The system will request your confirmation before it deletes all the configured static
routes.
Related commands: ip route-static, display ip routing-table.
# Delete all the static routes in the router.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] delete static-routes all
Are you sure to delete all the unicast static routes?[Y/N]y
ip-address: Destination IP address, in dotted decimal notation.
mask: Subnet mask, in dotted decimal notation.
mask-length: Mask length, in the range of 0 to 32.
interface-type interface-number: Next-hop outbound interface.
next-hop: Next hop IP address of the route, in dotted decimal notation.
preference preference-value: Preference level of a static route, in the range of 1 to 255.
The default preference is 60.
reject: Indicates the destination is unreachable. If a static route to a destination is
marked with reject, all IP packets destined for this destination will be discarded, and
the source host will be informed that the destination is unreachable.
blackhole: Indicates a blackhole route. If a static route to a destination is marked with
blackhole, the outbound interface of this route is the Null 0 interface regardless of the
next hop address, and all the IP packet addresses destined for this destination are
dropped without the source host being notified.
description text: Provides a description for the current route, which i s a string of 1 to 60
characters.
Note:
z If you specify the next-hop outgoing interface when configuring a static route, the
type of outgoing interface can be Null only.
zThe packets sent to a Null interface, which is a virtual interface, will be discarded
immediately. This can decrease the system load.
Description
Use the ip route-static command to configure a static route.
Use the undo ip route-static command to delete a static route.
By default, the system can obtain the subnet route directly connected to the router.
When you configure a static route, if no preference is specified for the route, the
preference defaults to 60, and if the route is not specified as reject or blackhole, the
route will be reachable by default.
When configuring a static route, note the following points:
zIf the destination IP address and the mask are both 0.0.0.0, what you are
configuring is a default route. All the packets that fail to find a routing entry will be
forwarded through this default route.
zYou cannot configure an interface address of the local switch as the next hop
address of a static route.
zYou can configure a different preference to implement flexible route management
policy.
Related commands: display ip routing-table.
Examples
# Configure the next hop of the default route as 129.102.0.2.
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] ip route-static 0.0.0.0 0.0.0.0 129.102.0.2
2-3
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.