H3C S3600 Series EPON OLT Switches Operation Manual-Release 3103-6W100

20-Static Routing Configuration

Chapters Download  (54.5 KB)

20-Static Routing Configuration


Go to these sections for information you are interested in:

l          IP Routing and Routing Table

l          Displaying and Maintaining a Routing Table

 

The term router in this document refers to an S3600 EPON OLT switch configured with Layer 3 interfaces such as VLAN interfaces or Loopback interfaces.

 

IP Routing and Routing Table

Routing

Routing in the Internet is achieved through routers. Upon receiving a packet, a router finds an optimal route based on the destination address and forwards the packet to the next router in the path until the packet reaches the last router, which forwards the packet to the intended destination host.

The S3600 Series EPON OLT Switches support static routing configuration. Static routing is easy in configuration and has lower system requirements, and thus is applicable to small-scale networks featuring simple topology and running stability.

Routing Table

Routing table

Routing tables play a key role in routing. Each router maintains a routing table, and each entry in the table specifies which physical interface a packet destined for a certain destination should go out to reach the next hop (the next router) or the directly connected destination.

Routes in a routing table of S3600 EPON OLT switch can be divided into two categories by origin:

l          Direct routes: Routes discovered by data link protocols, also known as interface routes.

l          Static routes: Routes that are manually configured.

Contents of a routing table

A routing table includes the following key items:

l          Destination address: Destination IP address or destination network.

l          Network mask: Specifies, in company with the destination address, the address of the destination network. A logical AND operation between the destination address and the network mask yields the address of the destination network. For example, if the destination address is 129.102.8.10 and the mask 255.255.0.0, the address of the destination network is 129.102.0.0. A network mask is made of a certain number of consecutive 1s. It can be expressed in dotted decimal format or by the number of the 1s.

l          Outbound interface: Specifies the interface through which the IP packets are to be forwarded.

l          IP address of the next hop: Specifies the address of the next router on the path. If only the outbound interface is configured, its address will be the IP address of the next hop.

l          Priority for the route. Routes to the same destination but having different nexthops may have different priorities and be found by various routing protocols or manually configured. The optimal route is the one with the highest priority (with the smallest metric).

Routes can be divided into two categories by destination:

l          Subnet routes: The destination is a subnet.

l          Host routes: The destination is a host.

Based on whether the destination is directly connected to a given router, routes can be divided into:

l          Direct routes: The destination is directly connected to the router.

l          Indirect routes: The destination is not directly connected to the router.

To prevent the routing table from getting too large, you can configure a default route. All packets without matching any entry in the routing table will be forwarded through the default route.

Displaying and Maintaining a Routing Table

To do…

Use the command…

Remarks

Display brief information about the active routes in the routing table

display ip routing-table [ verbose | | { begin | exclude | include } regular-expression ]

Available in any view

Display information about routes to the specified destination

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

Available in any view

Display information about routes with destination addresses in the specified range

display ip routing-table ip-address1 { mask-length | mask } ip-address2 { mask-length | mask } [ verbose ]

Available in any view

Display information about routes permitted by an IPv4 basic ACL

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

Available in any view

Display routes of a routing protocol

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

Available in any view

Display statistics about the network routing table

display ip routing-table statistics

Available in any view

Clear statistics for the routing table

reset ip routing-table statistics protocol { all | protocol }

Available in user view


 

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

l          Introduction

l          Configuring a Static Route

l          Displaying and Maintaining Static Routes

Introduction

Static Route

A static route is a manually configured. If a network’s topology is simple, you only need to configure static routes for the network to work normally. The proper configuration and usage of static routes can improve network performance and ensure bandwidth for important network applications.

The disadvantage of using static routes is that they cannot adapt to network topology changes. If a fault or a topological change occurs in the network, the routes will be unreachable and the network breaks. In this case, the network administrator has to modify the static routes manually.

Default Route

If the destination address of a packet fails to match any entry in the routing table, the packet will be discarded.

After a default route is configured on a router, any packet whose destination IP address matches no entry in the routing table can be forwarded to a designated upstream router.

A router selects the default route only when it cannot find any matching entry in the routing table.

l          If the destination address of a packet fails to match any entry in the routing table, the router selects the default route to forward the packet.

l          If there is no default route and the destination address of the packet fails to match any entry in the routing table, the packet will be discarded and an ICMP packet will be sent to the source to report that the destination or the network is unreachable.

The network administrator can configure a default route with both destination and mask being 0.0.0.0. The router forwards any packet whose destination address fails to match any entry in the routing table to the next hop of the default static route.

Application Environment of Static Routing

Before configuring a static route, you need to know the following concepts:

1)        Destination address and mask

In the ip route-static command, an IPv4 address is in dotted decimal format and a mask can be either in dotted decimal format or in the form of mask length (the digits of consecutive 1s in the mask).

2)        Output interface and next hop address

While configuring a static route, you can specify either the output interface or the next hop address depending on the specific occasion. The next hop address can not be a local interface IP address; otherwise, the route configuration will not take effect.

In fact, all the route entries must have a next hop address. When forwarding a packet, a router first searches the routing table for the route to the destination address of the packet. The system can find the corresponding link layer address and forward the packet only after the next hop address is specified.

When specifying the output interface, note that:

l          If the output interface is a Null 0 or loopback interface, there is no need to configure the next hop address.

l          If you specify a broadcast interface (such as VLAN interface) as the output interface, you must specify the corresponding next hop for the output interface.

3)        Other attributes

You can configure different preferences for different static routes so that route management policies can be applied more flexibly. For example, specifying the same preference for different routes to the same destination enables load sharing, while specifying different preferences for these routes enables route backup.

Configuring a Static Route

Configuration Prerequisites

Before configuring a static route, you need to finish the following tasks:

l          Configure the physical parameters for related interfaces

l          Configure the link-layer attributes for related interfaces

l          Configure the IP addresses for related interfaces

Configuration Procedure

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 dest-address { mask | mask-length } { next-hop-address | interface-type interface-number next-hop-address } [ preference preference-value ] [ description description-text ]

Required

By default, preference for static routes is 60, and no description information is configured.

Configure the default preference for static routes

ip route-static default-preference default-preference-value

Optional

60 by default

 

l          When configuring a static route, the static route does not take effect if you specify the next hop address first and then configure it as the IP address of a local interface, such as a VLAN interface.

l          If you do not specify the preference when configuring a static route, the default preference will be used. Reconfiguring the default preference applies only to newly created static routes.

l          If the destination IP address and mask are both configured as 0.0.0.0 with the ip route-static command, the route is the default route.

 

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 the IP routing table

display ip routing-table

Display the detailed information of the IP routing table

display ip routing-table verbose

View information of static routes

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

Delete all the static routes

delete static-routes all

Available In system view

 

H3C reserves the right to modify its collaterals without any prior notice. For the latest information of the collaterals, please consult H3C sales or call 400 hotline.