- Table of Contents
-
- H3C S3100-52P Operation Manual-Release 1602(V1.01)
- 00-1Cover
- 00-2Product Overview
- 01-CLI Operation
- 02-Login Operation
- 03-Configuration File Management Operation
- 04-VLAN Operation
- 05-IP Address and Performance Operation
- 06-Voice VLAN Operation
- 07-GVRP Operation
- 08-Port Basic Configuration Operation
- 09-Link Aggregation Operation
- 10-Port Isolation Operation
- 11-Port Security-Port Binding Operation
- 12-DLDP Operation
- 13-MAC Address Table Management Operation
- 14-MSTP Operation
- 15-Static Route Operation
- 16-Multicast Operation
- 17-802.1x and System Guard Operation
- 18-AAA Operation
- 19-Web Authentication Operation
- 20-MAC Address Authentication Operation
- 21-ARP Operation
- 22-DHCP Operation
- 23-ACL Operation
- 24-QoS-QoS Profile Operation
- 25-Mirroring Operation
- 26-Stack-Cluster Operation
- 27-SNMP-RMON Operation
- 28-NTP Operation
- 29-SSH Operation
- 30-File System Management Operation
- 31-FTP-SFTP-TFTP Operation
- 32-Information Center Operation
- 33-System Maintenance and Debugging Operation
- 34-VLAN-VPN Operation
- 35-HWPing Operation
- 36-IPv6 Management Operation
- 37-DNS Operation
- 38-Smart Link-Monitor Link Operation
- 39-Appendix
- Related Documents
-
Title | Size | Download |
---|---|---|
15-Static Route Operation | 112.43 KB |
Table of Contents
Chapter 1 IP Routing Protocol Overview
1.1 Introduction to IP Route and Routing Table
1.1.3 Routing Protocols and Routing Priority
1.2 Displaying and Maintaining a Routing Table
Chapter 2 Static Route Configuration
2.1 Introduction to Static Route
2.2 Static Route Configuration
2.2.1 Configuration Prerequisites
2.2.2 Configuring a Static Route
2.3 Displaying and Maintaining Static Routes
2.4 Static Route Configuration Example
2.5 Troubleshooting a Static Route
Chapter 1 IP Routing Protocol Overview
Go to these sections for information you are interested in:
l Introduction to IP Route and Routing Table
l Displaying and Maintaining a Routing Table
& 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 Introduction to IP Route and Routing Table
1.1.1 IP Route
Routers are used for route selection on the Internet. As a router receives a packet, it selects an appropriate route (through a network) according to the destination address of the packet and forwards the packet to the next router. The last router on the route is responsible for delivering the packet to the destination host.
1.1.2 Routing Table
I. Function
The key for a router to forward packets is the routing table. Each router maintains a routing table. Each entry in this table contains an IP address that represents a host/subnet and specifies which physical port on the router should be used to forward the packets destined for the host/subnet. And the router forwards those packets through this port to the next router or directly to the destination host if the host is on a network directly connected to the router.
II. Routing entry
Each routing entry in a routing table contains:
l Destination: It identifies the address of the destination host or network of an IP packet.
l Mask: Along with the destination address, it identifies the address of the network segment where the destination host or router resides. By performing a logical AND operation between destination address and network mask, you can get the address of the network segment where the destination host or router resides. For example, if the destination address is 129.102.8.10 and the mask is 255.255.0.0, the address of the network segment where the destination host or router resides is 129.102.0.0. A mask consists of some consecutive 1s, represented either in dotted decimal notation or by the number of the consecutive 1s in the mask.
l Interface: It indicates through which interface IP packets should be forwarded to the destination.
l Nexthop: It indicates the next router that IP packets will pass through to reach the destination.
l Preference: There may be multiple routes with different next hops to the same destination. These routes may be discovered by different routing protocols, or be manually configured static routes. The one with the highest preference (the smallest numerical value) will be selected as the current optimal route.
According to different destinations, routes fall into the following categories:
l Subnet route: The destination is a subnet.
l Host route: The destination is a host.
In addition, according to whether the network where the destination resides is directly connected to the router, routes fall into the following categories:
l Direct route: The router is directly connected to the network where the destination resides.
l Indirect route: The router is not directly connected to the network where the destination resides.
In order to avoid an oversized routing table, you can set a default route. All the packets for which the router fails to find a matching entry in the routing table will be forwarded through this default route.
Figure 1-1 shows a relatively complicated internet environment, the number in each network cloud indicate the network address. Router G is connected to three networks, and so it has three IP addresses and three physical ports. Its routing table is shown in Figure 1-1.
Destination Network |
Nexthop |
Interface |
11.0.0.0 |
14.0.0.1 |
3 |
12.0.0.0 |
14.0.0.1 |
3 |
13.0.0.0 |
16.0.0.1 |
2 |
14.0.0.0 |
14.0.0.3 |
3 |
15.0.0.0 |
17.0.0.2 |
1 |
16.0.0.0 |
16.0.0.2 |
2 |
17.0.0.0 |
17.0.0.1 |
1 |
1.1.3 Routing Protocols and Routing Priority
The following table lists some routing protocols and the default priorities for routes found by them:
Table 1-1 Routing protocols and priorities of their default route
Routing approach |
Priority |
DIRECT |
0 |
STATIC |
60 |
& Note:
l The smaller the priority value, the higher the priority.
l The priority for a direct route is always 0, which you cannot change. Any other type of routes can have their priorities manually configured.
l Each static route can be configured with a different priority.
1.1.4 Route Backup
You can configure multiple routes to the same destination, expecting the one with the highest priority to be the primary route and all the rest backup routes.
Route backup can help improve network reliability. Automatic switching can happen between the primary route and a backup route.
Under normal circumstances, packets are forwarded through the primary route. When the primary route goes down, the route with the highest priority among the backup routes is selected to forward packets. When the primary route recovers, the route selection process is performed again and the primary route is selected again to forward packets.
1.2 Displaying and Maintaining a Routing Table
To do… |
Use the command… |
Remarks |
Display brief information about a routing table |
display ip routing-table [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Display detailed information about a routing table |
display ip routing-table verbose |
|
Display information about routes permitted by a basic ACL |
display ip routing-table acl acl-number [ verbose ] |
|
Display routes to a specified destination |
display ip routing-table ip-address [ mask | mask-length ] [ longer-match ] [ verbose ] |
|
Display routes to specified destinations |
display ip routing-table ip-address1 { mask1 | mask-length1 } ip-address2 { mask2 | mask-length2 } [ verbose ] |
|
Display routes discovered by a routing protocol |
display ip routing-table protocol protocol [ inactive | verbose ] |
|
Display the tree-structured routing table information |
display ip routing-table radix |
|
Display statistics about a routing table |
display ip routing-table statistics |
|
Clear statistics about a routing table |
reset ip routing-table statistics protocol { all | protocol } |
Available in user view |
Chapter 2 Static Route Configuration
When configuring a static route, go to these sections for information you are interested in:
l Introduction to Static Route
l Displaying and Maintaining Static Routes
l Static Route Configuration Example
l Troubleshooting a Static Route
& 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 Introduction to Static Route
2.1.1 Static Route
Static routes are special routes. They are manually configured by the administrator. In a relatively simple network, you only need to configure static routes to make routers work normally. Proper configuration and usage of static routes can improve network performance and ensure sufficient bandwidth for important applications.
When the network topology changes, static routes may become unreachable because they cannot adapt themselves to the change automatically, thus resulting in network interruption. In this case, the network administrator needs to modify the configuration of static routes manually.
Static routes are divided into three types:
l Reachable route: normal route. If a static route to a destination is of this type, the IP packets destined for this destination will be forwarded to the next hop. It is the most common type of static routes.
l Unreachable route: route with the reject attribute. If a static route to a destination has the reject attribute, all the IP packets destined for this destination will be discarded, and the source hosts will be informed of the unreachability of the destination.
l Blackhole route: route with blackhole attribute. If a static route destined for a destination has the blackhole attribute, the outgoing interface of this route is the Null 0 interface regardless of the next hop address, and all the IP packets addressed to this destination will be dropped without notifying the source hosts.
The attributes reject and blackhole are usually used to limit the range of the destinations this router can reach, and help troubleshoot the network.
2.1.2 Default Route
To avoid too large a routing table, you can configure a default route.
When the destination address of a packet fails to match any entry in the routing table,
l If there is default route in the routing table, the default route will be selected to forward the packet.
l If there is no default route, the packet will be discarded and an ICMP Destination Unreachable or Network Unreachable packet will be returned to the source.
2.2 Static Route Configuration
2.2.1 Configuration Prerequisites
Before configuring a static route, perform the following tasks:
l Configuring the physical parameters of related interfaces
l Configuring IP addresses for related interfaces
2.2.2 Configuring a Static Route
Follow these steps to configure a static route:
To do... |
Use the command... |
Remarks |
Enter system view |
system-view |
— |
Configure a static route |
ip route-static ip-address { mask | mask-length } { interface-type interface-number | next-hop } [ preference preference-value ] [ reject | blackhole ] [ description text ] |
Required By default, the system can obtain the route to the subnet directly connected to the router. |
& Note:
l Use the ip route-static command to configure a default route by setting the destination IP address and the mask to 0.0.0.0.
l Avoid configuring the next hop address of a static route to the address of an interface on the local switch.
l Different preferences can be configured to implement flexible route management policies.
2.3 Displaying and Maintaining Static Routes
To do... |
Use the command... |
Remarks |
Display the current configuration information |
display current-configuration |
Available in any view |
Display the brief information of a routing table |
display ip routing-table |
|
Display the detailed information of a routing table |
display ip routing-table verbose |
|
Display the information of static routes |
display ip routing-table protocol static [ inactive | verbose ] |
|
Delete all static routes |
delete static-routes all |
Available in system view |
2.4 Static Route Configuration Example
I. Network requirements
In this case, static routes can implement communication between any two nodes.
II. Network diagram
According to the network requirements, the network topology is designed as shown in Figure 2-1.
Figure 2-1 Network diagram for static route configuration
III. Configuration procedure
& Note:
When only one interface of the device is interconnected with another network segment, you can implement network communication by configuring either a static route or default route.
1) Perform the following configurations on the switch.
# Approach 1: Configure static routes on Switch A.
<SwitchA> system-view
[SwitchA] ip route-static 1.1.3.0 255.255.255.0 1.1.2.2
[SwitchA] ip route-static 1.1.4.0 255.255.255.0 1.1.2.2
[SwitchA] ip route-static 1.1.5.0 255.255.255.0 1.1.2.2
# Approach 2: Configure a static route on Switch A.
<SwitchA> system-view
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.2.2
# Approach 1: Configure static routes on Switch B.
<SwitchB> system-view
[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.3.1
[SwitchB] ip route-static 1.1.5.0 255.255.255.0 1.1.3.1
[SwitchB] ip route-static 1.1.1.0 255.255.255.0 1.1.3.1
# Approach 2: Configure a static route on Switch B.
<SwitchB> system-view
[SwitchB] ip route-static 0.0.0.0 0.0.0.0 1.1.3.1
# Configure static routes on Switch C.
<SwitchC> system-view
[SwitchC] ip route-static 1.1.1.0 255.255.255.0 1.1.2.1
[SwitchC] ip route-static 1.1.4.0 255.255.255.0 1.1.3.2
2) Perform the following configurations on the host.
# Set the default gateway address of Host A to 1.1.5.1. Detailed configuration procedure is omitted.
# Set the default gateway address of Host B to 1.1.4.1. Detailed configuration procedure is omitted.
# Set the default gateway address of Host C to 1.1.1.1. Detailed configuration procedure is omitted.
Now, all the hosts and switches in the figure can communicate with each other.
2.5 Troubleshooting a Static Route
Symptom: The switch is not configured with a dynamic routing protocol. Both the physical status and the link layer protocol status of an interface are UP, but IP packets cannot be forwarded on the interface.
Solution: Perform the following procedure.
1) Use the display ip routing-table protocol static command to view whether the corresponding static route is correctly configured.
2) Use the display ip routing-table command to view whether the static route is valid.