H3C S9500 Operation Manual-Release1648[v1.24]-03 IP Routing Volume

HomeSupportSwitchesH3C S9500 Series SwitchesConfigure & DeployConfiguration GuidesH3C S9500 Operation Manual-Release1648[v1.24]-03 IP Routing Volume
02-Static Route Configuration
Title Size Download
02-Static Route Configuration 61.76 KB

Chapter 1  Static Route Configuration

When configuring static route, go to these sections for information you are interested in:

l           Introduction to Static Route

l           Configuring Static Route

l           Displaying and Debugging Static Route

l           Static Route Configuration Example

l           Troubleshooting Static Route

 

&  Note:

l      The term “router” or the router icon in this document refers to a router in a generic sense or an S9500 switch running routing protocols.

l      For details about VPN instance, refer to the MPLS VPN Volume.

 

1.1  Introduction to Static Route

1.1.1  Static Route

A static route is a special route configured manually by an administrator. You can set up an interconnecting network with the static route configuration. The problem for such configuration is when a fault occurs to the network, the static route cannot change automatically to steer away from the node causing the fault, if without the help of an administrator.

In a relatively simple network, you only need to configure the static routes to make the router work normally. The proper configuration and usage of the static route can improve the network performance and ensure the bandwidth of the important applications.

All the following routes are static routes:

l           Reachable route: A normal route is of this type. That is, the IP packet is sent to the next hop via the route marked by the destination. It is a common type of static routes.

l           Unreachable route: When a static route to a destination has the reject attribute, all the IP packets to this destination will be discarded, and the source host will be informed that the destination is unreachable.

l           Blackhole route: If a static route to a destination has the blackhole attribute, the outgoing interface of this route is the Null 0 interface regardless of the next hop address, and any IP packets addressed to this destination are dropped without notifying the source host.

The attributes reject and blackhole are usually used to control the range of reachable destinations of this router, and help troubleshoot the network.

1.1.2  Default Route

A default route is a special route. You can configure a default route using a static route. Some dynamic routing protocols can also generate default routes, such as OSPF and IS-IS.

In brief, a default route is used only when no suitable routing table entry is matched. That is, when no proper route is found, the default route is used. In a routing table, the default route is in the form of the route to the network 0.0.0.0 (with the mask 0.0.0.0). You can see whether the default route has been set by executing the display ip routing-table command. If the destination address of a packet fails in matching any entry of the routing table, the router will select the default route to forward this packet. If there is no default route and the destination address of the packet fails in matching any entry in the routing table, this packet will be discarded, and an Internet Control Message Protocol (ICMP) packet will be sent to the originating host to inform that the destination host or network is unreachable.

1.2  Configuring Static Route

Static route configuration includes:

l           Configuring a Static Route

l           Configuring a Default Route

l           Deleting All the Static Routes

1.2.1  Configuring a Static Route

Perform the following configurations in system view to add/delete a static route:

To do...

Use the command...

Add a static route

ip route-static ip-address { mask | mask-length } { interface-type interface-number } [ nexthop-ip-address ] [ preference preference-value | tag tag-value ] * [ reject | blackhole ] [ description text ]

ip route-static [ vpn-instance vpn-instance-name-list ] ip-address { mask | mask-length } { interface-type interface-number | vpn-instance vpn-instance-name nexthop-ip-address } [ public ] [ preference preference-value | tag tag-value | public ] * [ reject | blackhole ]  [ description text ]

Delete a static route

undo ip route-static ip-address { mask | mask-length } { interface-type interface-number } [ nexthop-ip-address ] [ preference preference-value ]

undo ip route-static vpn-instance vpn-instance-name-list destination-ip-address { mask | mask-length } [ interface-name | vpn-instance vpn-nexthop-name ] nexthop-ip-address [ public ] [ preference preference-value ]

 

The parameters are explained as follows:

l           IP address and mask

The IP address and mask are in a dotted decimal format. As 1s in the 32-bit mask are required to be consecutive, the dotted decimal mask can also be replaced by the mask-length (which refers to the digits of the consecutive 1s in the mask).

l           Next hop address and NULL interface

When configuring a static route, you can specify the nexthop-ip-address to decide the next hop address, depending on the actual conditions.

In fact, for all the routing entries, the next hop address must be specified. When IP layer transmits an IP packet, it will first search the matching route in the routing table according to the destination address of the packet. Only when the next hop address of the route is specified can the link layer find the corresponding link layer address, and then forward the packet according to this address.

The packets sent to NULL interface, a kind of virtual interface, will be discarded at once. This can decrease the system load.

l           Preference

Depending on the configuration of preference, you can achieve different route management policies. For example, to implement load sharing, you can specify the same preference for multiple routes to the same destination network. To implement route backup, you can specify different preferences for them.

l           Other parameters

tag tag-value: Specifies a tag value for the static route. The default tag value is 0.

The attributes reject and blackhole respectively indicate the unreachable route and the blackhole route.

description: Specifies a description for the configuration.

1.2.2  Configuring a Default Route

Perform the following configurations in system view to configure/delete a default route:

To do...

Use the command...

Configure a default route

ip route-static 0.0.0.0 { 0.0.0.0 | 0 } { interface-type interface-number | gateway-address } [ preference value ] [ reject | blackhole ]

Delete a default route

undo ip route-static 0.0.0.0 { 0.0.0.0 | 0 } [ interface-type interface-number | gateway-address ] [ preference value ]

 

The meanings of parameters in the command are the same as those of the static route.

1.2.3  Deleting All the Static Routes

You can use the undo ip route-static command to delete one static route. The S9500 series also provide the following commands for you to delete all static routes at one time, including the default routes.

Perform the following configuration in system view to delete all static routes:

To do...

Use the command...

Delete all static routes

delete static-routes all

Delete all static routes of the VPN

delete vpn-instance vpn-instance-name static-routes all

 

1.3  Displaying and Debugging Static Route

To do...

Use the command...

Remarks

Display routing table summary

display ip routing-table

Available in any view

Display routing table details

display ip routing-table verbose

Display the detailed information of a specific route

display ip routing-table ip-address [ mask | mask-length ] [ longer-match ] [ verbose ]

Display the route information in the specified address range

display ip routing-table ip-address1 mask1 ip-address2 mask2 [ verbose ]

Display the route filtered through the specified basic access control list (ACL)

display ip routing-table acl { acl-number | acl-name } [ verbose ]

Display the route information that is filtered through the specified ip prefix list

display ip routing-table ip-prefix ip-prefix-number [ verbose ]

Display the routing information discovered by the specified protocol

display ip routing-table protocol protocol [ inactive | verbose ]

Display the tree routing table

display ip routing-table radix

Display the statistics of the routing table

display ip routing-table statistics

Display the routing information about the VPN instance

display ip routing-table vpn-instance vpn-instance-name [ ip-address ] [ verbose ] [ statistics ]

 

1.4  Static Route Configuration Example

I. Network requirements

As shown in Figure 1-1, the masks of all the IP addresses are 255.255.255.0. It is required that all the hosts or S9500 series routing switches can be interconnected in pairs by static route configuration.

II. Network diagram

Figure 1-1 Network diagram for the static route configuration

III. Configuration procedure

# Configure the static route for Switch A.

[Switch A] ip route-static 1.1.3.0 255.255.255.0 1.1.2.2

[Switch A] ip route-static 1.1.4.0 255.255.255.0 1.1.2.2

[Switch A] ip route-static 1.1.5.0 255.255.255.0 1.1.2.2

# Configure the static route for Switch B.

[Switch B] ip route-static 1.1.2.0 255.255.255.0 1.1.3.1

[Switch B] ip route-static 1.1.5.0 255.255.255.0 1.1.3.1

[Switch B] ip route-static 1.1.1.0 255.255.255.0 1.1.3.1

# Configure the static route for Switch C.

[Switch C] ip route-static 1.1.1.0 255.255.255.0 1.1.2.1

[Switch C] ip route-static 1.1.4.0 255.255.255.0 1.1.3.2

# Configure the default gateway of the Host A to be 1.1.1.2.

# Configure the default gateway of the Host B to be 1.1.4.1.

# Configure the default gateway of the Host C to be 1.1.5.2.

Then, all the hosts or switches in the figure can be interconnected in pairs.

1.5  Troubleshooting Static Route

Symptom:

The switch is configured with the static routing protocol and both the physical status and the link layer protocol status of the interface are Up, but the IP packets cannot be forwarded normally.

Solution:

Use the display ip routing-table protocol static command to view whether the configured static route is correct and in effect.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网