H3C S3100-52P Command Manual

Page 1
Command Manual – Static Route H3C S3100-52P Ethernet Switch Table of Contents
Table of Contents
Chapter 1 IP Routing Table Commands...................................................................................... 1-1
1.1 IP Routing Table Commands.............................................................................................1-1
1.1.1 display ip routing-table............................................................................................1-1
1.1.2 display ip routing-table acl.......................................................................................1-3
1.1.3 display ip routing-table ip-address.......................................................................... 1-6
1.1.4 display ip routing-table ip-address1 ip-address2....................................................1-7
1.1.5 display ip routing-table protocol ..............................................................................1-8
1.1.6 display ip routing-table radix ...................................................................................1-9
1.1.7 display ip routing-table statistics ...........................................................................1-10
1.1.8 display ip routing-table verbose ............................................................................1-11
1.1.9 reset ip routing-table statistics protocol................................................................. 1-12
Chapter 2 Static Route Configuration Commands ....................................................................2-1
2.1 Static Route Configuration Commands ............................................................................. 2-1
2.1.1 delete static-routes all............................................................................................. 2-1
2.1.2 ip route-static...........................................................................................................2-2
i
Page 2
Command Manual – Static Route H3C S3100-52P Ethernet Switch

Chapter 1 IP Routing Table Commands

Note:
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.
1-1
Page 3
Command Manual – Static Route H3C S3100-52P Ethernet Switch
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
1.1.1.0/24 DIRECT 0 0 1.1.1.1 Vlan-interface1
1-2
Page 4
Command Manual – Static Route H3C S3100-52P Ethernet Switch
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
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.
1-3
Page 5
Command Manual – Static Route H3C S3100-52P Ethernet Switch
<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
**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) State: <Int ActiveU Retain Unicast> Age: 35:37:03 Cost: 0/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) State: <NoAdvise Int ActiveU Retain Gateway Unicast> Age: 35:37:03 Cost: 0/0
Chapter 1 IP Routing Table
Commands
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.
1-4
Page 6
Command Manual – Static Route H3C S3100-52P Ethernet Switch
Field Description
Description of route state: ActiveU An active unicast route, where “U” represents unicast.
Chapter 1 IP Routing Table
Commands
State
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.
An existing route that is temporarily unavailable for some Hidden
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.
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 Holddown
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 disco v ered by IGP.
A routing protocol does not advertise any NoAdvise route NoAdvise
when advertising routes in accordance with a routing
policy.
A NotInstall route cannot be added to the core routing NotInstall
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.
The routes marked with reject do not guide the router to
forward packets as a normal route doe s. The router Reject
discards the packets matching reject routes and sends
an ICMP unreachable message to the source.
Reject routes are usually used for network tests.
The routes marked with retain will not be deleted when Retain
you delete routes in the core routing table. You can mark
static routes with retain to make them stay in the core
routing table.
The routes marked with static will not be deleted from Static
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.
1-5
Page 7
Command Manual – Static Route H3C S3100-52P Ethernet Switch

1.1.3 display ip routing-table ip-address

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.
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:
z display ip routing-table ip-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-table ip-address mask
This command only displays the routes exactly matching the specified destination address and mask.
z display ip routing-table ip-address longer-match
This command displays all destination address routes matching the specified destination address in the natural mask range.
Examples
z display ip routing-table ip-address mask longer-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.
1-6
Page 8
Command Manual – Static Route H3C S3100-52P Ethernet Switch
<Sysname> 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 descriptions of the above fields, see Table 1-1. # Display the detailed information of routes with a natural mask.
<Sysname> display ip routing-table 169.0.0.0 verbose Routing tables: + = Active Route, - = Last Active, # = Both * = Next hop in use Summary count: 1 **Destination: 169.0.0.0 Mask: 255.255.255.0 Protocol: #STATIC Preference: 60 *NextHop: 2.1.1.1 Interface: 2.1.1.1(LoopBack1) State: <Int ActiveU Gateway Static Unicast> Age: 4:49 Cost: 0/0
For descriptions of the above fields, see Table 1-2.
Chapter 1 IP Routing Table
Commands

1.1.4 display ip routing-table ip-address1 ip-address2

Syntax
display ip routing-table ip-address1 { mask1 | mask-length1 } ip-address2 { mask2 | mask-length2 } [ verbose ]
View
Any view
Parameters
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 ANDed with {mask1 | mask-length1} specifies the start of the range, while ip-address2 ANDed with {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.
1-7
Page 9
Command Manual – Static Route H3C S3100-52P Ethernet Switch
Examples
# 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
1-8
Page 10
Command Manual – Static Route H3C S3100-52P Ethernet Switch
DIRECT Routing tables status:<active>: Summary count: 3 Destination/Mask Protocol Pre Cost Nexthop Interface
20.1.1.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 DIRECT Routing tables status:<inactive>: Summary count: 1 Destination/Mask Protocol Pre Cost Nexthop Interface
210.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
For detailed description of the output information, see Table 1-1.

1.1.6 display ip routing-table radix

Syntax
display ip routing-table radix
Chapter 1 IP Routing Table
Commands
View
Parameters
Description
Examples
Any view
None
Use the display ip routing-table radix command to display the route information in a tree structure.
<Sysname> display ip routing-table radix Radix tree for INET (2) inodes 7 routes 5: +-32+--{210.0.0.1 +--0+ | | +--8+--{127.0.0.0 | | | +-32+--{127.0.0.1 | +--1+ | +--8+--{20.0.0.0 | +-32+--{20.1.1.1
1-9
Page 11
Command Manual – Static Route H3C S3100-52P Ethernet Switch
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
1-10
Page 12
Command Manual – Static Route H3C S3100-52P Ethernet Switch
Field Description
active Number of active routes
Chapter 1 IP Routing Table
Commands
added
deleted
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)
1-11
Page 13
Command Manual – Static Route H3C S3100-52P Ethernet Switch
State: <NoAdvise Int ActiveU Retain Gateway Unicast> Age: 20:17:42 Cost: 0/0 **Destination: 2.2.2.0 Mask: 255.255.255.0 Protocol: #DIRECT Preference: 0 *NextHop: 2.2.2.1 Interface: 2.2.2.1(Vlan-interface2) State: <Int ActiveU Retain Unicast> Age: 20:08:05 Cost: 0/0
For descriptions of route states, see Table 1-2.
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
1-12
Page 14
Command Manual – Static Route H3C S3100-52P Ethernet Switch
STATIC 0 0 0 0 Total 4 4 12 8
# Clear the routing statistics of all protocols from the IP routing table.
<Sysname> reset ip routing-table statistics protocol all
# Display the routing statistics in the IP routing table.
<Sysname> display ip routing-table statistics Routing tables: Proto route active added deleted DIRECT 4 4 0 0 STATIC 0 0 0 0 Total 4 4 0 0
The above information shows that the routing statistics in the IP rou ting table is cleared.
Chapter 1 IP Routing Table
Commands
1-13
Page 15
Command Manual – Static Route H3C S3100-52P Ethernet Switch Chapter 2 Static Route Configuration Commands

Chapter 2 Static Route Configuration Commands

Note:
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
2-1
Page 16
Command Manual – Static Route H3C S3100-52P Ethernet Switch Chapter 2 Static Route Configuration Commands

2.1.2 ip route-static

Syntax
ip route-static ip-address { mask | mask-length } { interface-type interface-number | next-hop } [ preference preference-value ] [ reject | blackhole ] [ description text ]
undo ip route-static ip-address { mask | mask-length } [ interface-type interface-number | next-hop ] [ preference preference-value ]
View
System view
Parameters
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.
z The 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.
2-2
Page 17
Command Manual – Static Route H3C S3100-52P Ethernet Switch Chapter 2 Static Route Configuration Commands
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:
z If 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.
z You cannot configure an interface address of the local switch as the next hop
address of a static route.
z You 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...