12-IPv4 Routing Configuration

Download

Table of Contents

Chapter 1 Static Routing Configuration. 1-1

1.1 Introduction. 1-1

1.1.1 Static Route. 1-1

1.1.2 Default Route. 1-1

1.1.3 Application Environment of Static Routing. 1-2

1.2 Configuring a Static Route. 1-2

1.2.1 Configuration Prerequisites. 1-2

1.2.2 Configuration Procedure. 1-2

1.3 Detecting Reachability of the Static Route’s Nexthop. 1-3

1.3.1 Detecting Nexthop Reachability Through Track. 1-3

1.4 Displaying and Maintaining Static Routes. 1-4

1.5 Configuration Example. 1-5

Chapter 2 RIP Configuration. 2-1

2.1 RIP Overview. 2-1

2.1.1 RIP Working Mechanism.. 2-1

2.1.2 Operation of RIP. 2-3

2.1.3 RIP Version. 2-3

2.1.4 RIP Message Format 2-4

2.1.5 Supported RIP Features. 2-5

2.1.6 Protocols and Standards. 2-5

2.2 Configuring RIP Basic Functions. 2-6

2.2.1 Configuration Prerequisites. 2-6

2.2.2 Configuration Procedure. 2-6

2.3 Configuring RIP Route Control 2-8

2.3.1 Configuring an Additional Routing Metric. 2-8

2.3.2 Configuring RIPv2 Route Summarization. 2-9

2.3.3 Disabling Host Route Reception. 2-10

2.3.4 Advertising a Default Route. 2-10

2.3.5 Configuring Inbound/Outbound Route Filtering. 2-11

2.3.6 Configuring a Priority for RIP. 2-11

2.3.7 Configuring RIP Route Redistribution. 2-12

2.4 Configuring RIP Network Optimization. 2-12

2.4.1 Configuring RIP Timers. 2-12

2.4.2 Configuring Split Horizon and Poison Reverse. 2-13

2.4.3 Enabling Zero Field Check on Incoming RIPv1 Messages. 2-14

2.4.4 Enabling Source IP Address Check on Incoming RIP Updates. 2-14

2.4.5 Configuring RIPv2 Message Authentication. 2-15

2.4.6 Specifying a RIP Neighbor 2-15

2.5 Displaying and Maintaining RIP. 2-16

2.6 RIP Configuration Examples. 2-16

2.6.1 Configuring RIP Version. 2-16

2.7 Troubleshooting RIP. 2-18

2.7.1 No RIP Updates Received. 2-18

2.7.2 Route Oscillation Occurred. 2-18

Chapter 3 Routing Policy Configuration. 3-1

3.1 Introduction to Routing Policy. 3-1

3.1.1 Routing Policy. 3-1

3.1.2 Filters. 3-1

3.1.3 Routing Policy Application. 3-2

3.2 Routing Policy Configuration Task List 3-3

3.3 Defining Filtering Lists. 3-3

3.3.1 Prerequisites. 3-3

3.3.2 Defining an IPv4 prefix List 3-3

3.4 Configuring a Routing Policy. 3-4

3.4.1 Prerequisites. 3-4

3.4.2 Creating a Routing Policy. 3-4

3.4.3 Defining if-match Clauses for the Routing Policy. 3-5

3.4.4 Defining apply Clauses for the Routing Policy. 3-6

3.5 Displaying and Maintaining the Routing Policy. 3-7

3.6 Routing Policy Configuration Example. 3-7

3.6.1 Applying Routing Policy When Redistributing IPv4 Routes. 3-7

3.7 Troubleshooting Routing Policy Configuration. 3-9

3.7.1 IPv4 Routing Information Filtering Failure. 3-9

 


Chapter 1  Static Routing Configuration

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

l           Introduction

l           Configuring a Static Route

l           Detecting Reachability of the Static Route’s Nexthop

l           Displaying and Maintaining Static Routes

l           Configuration Example

 

&  Note:

The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.

 

1.1  Introduction

1.1.1  Static Route

A static route is a special route that is manually configured by the network administrator. 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.

1.1.2  Default Route

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

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.

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.

You can create the default route with both destination and mask being 0.0.0.0, and some dynamic routing protocols, such as OSPF, RIP and IS-IS, can also generate the default route.

1.1.3  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 interface, there is no need to configure the next hop address.

l           You are not recommended to specify a broadcast interface (such as VLAN interface) as the output interface, because a broadcast interface may have multiple next hops. If you have to do so, 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.

1.2  Configuring a Static Route

1.2.1  Configuration Prerequisites

Before configuring a static route, you need to configure the IP addresses for related interfaces.

1.2.2  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 ] [ tag tag-value ] [ description description-text ]

Required

By default, preference for static routes is 60, tag is 0, 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

 

&  Note:

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      You can flexibly control static routes by configuring tag values and using the tag values in the routing policy.

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.

 

1.3  Detecting Reachability of the Static Route’s Nexthop

If a static route fails due to a topology change or a fault, the connection will be interrupted. To improve network stability, the system needs to detect reachability of the static route’s next hop and switch to a backup route once the next hop is unreachable.

1.3.1  Detecting Nexthop Reachability Through Track

If you specify the nexthop but not outgoing interface when configuring a static route, you can associate the static route with a track entry to check the static route validity:

l           When the track entry is positive, the static route's nexthop is reachable and the static route takes effect.

l           When the track entry is negative, the static route's nexthop is unreachable and the static route is invalid. For details about track, refer to Track Configuration.

I. Network requirements

To detect the reachability of a static route's nexthop through a Track entry, you need to create a Track first. For detailed Track configuration procedure, refer to Track Configuration.

II. Configuration procedure

Follow these steps to detect the reachability of a static route's nexthop through Track:

To do…

Use the command…

Remarks

Enter system view

system-view

Associate the static route with a track entry

ip route-static dest-address { mask | mask-length } next-hop-address track track-entry-number [ preference preference-value ] [ tag tag-value ] [ description description-text ]

Required

Not configured by default

 

&  Note:

l      To configure this feature for an existing static route, simply associate the static route with a track entry. For a non-existent static route, configure it and associate it with a Track entry.

l      If a static route needs route recursion, the associated track entry must monitor the nexthop of the recursive route instead of that of the static route; otherwise, a valid route may be mistakenly considered invalid.

 

1.4  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

 

1.5  Configuration Example

I. Network requirements

The IP addresses and masks of the switches and hosts are shown in the following figure. Static routes are required for interconnection between any two hosts.

II. Network diagram

Figure 1-1 Network diagram for static route configuration

III. Configuration procedure

1)         Configuring IP addresses for interfaces (omitted)

2)         Configuring static routes

# Configure a default route on Switch A

<SwitchA> system-view

[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2

# Configure two static routes on Switch B

<SwitchB> system-view

[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.4.1

[SwitchB] ip route-static 1.1.3.0 255.255.255.0 1.1.5.6

# Configure a default route on Switch C

<SwitchC> system-view

[SwitchC] ip route-static 0.0.0.0 0.0.0.0 1.1.5.5

3)         Configure the hosts

The default gateways for the three hosts A, B and C are 1.1.2.3, 1.1.6.1 and 1.1.3.1 respectively. The configuration procedure is omitted.

4)         Display the configuration result

# Display the IP routing table of Switch A.

[SwitchA] display ip routing-table

Routing Tables: Public

         Destinations : 7       Routes : 7

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

0.0.0.0/0           Static 60   0            1.1.4.2         Vlan500

1.1.2.0/24          Direct 0    0            1.1.2.3         Vlan300

1.1.2.3/32          Direct 0    0            127.0.0.1       InLoop0

1.1.4.0/30          Direct 0    0            1.1.4.1         Vlan500

1.1.4.1/32          Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

# Display the IP routing table of Switch B.

[SwitchB] display ip routing-table

Routing Tables: Public

         Destinations : 10       Routes : 10

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

 

1.1.2.0/24          Static 60   0            1.1.4.1         Vlan500

1.1.3.0/24          Static 60   0            1.1.5.6         Vlan600

1.1.4.0/30          Direct 0    0            1.1.4.2         Vlan500

1.1.4.2/32          Direct 0    0            127.0.0.1       InLoop0

1.1.5.0/30          Direct 0    0            1.1.5.5         Vlan600

1.1.5.5/32          Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

1.1.6.0/24          Direct 0    0            1.1.6.1         Vlan100

1.1.6.1/32          Direct 0    0            127.0.0.1       InLoop0     

# From Host A, use the ping command to verify the network layer reachability to Host B and Host C.

 


Chapter 2  RIP Configuration

 

&  Note:

l      The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.

l      The S5500-SI series only support single RIP process.

 

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

l           RIP Overview

l           Configuring RIP Basic Functions

l           Configuring RIP Route Control

l           Configuring RIP Network Optimization

l           Displaying and Maintaining RIP

l           RIP Configuration Examples

l           Troubleshooting RIP

2.1  RIP Overview

RIP is a simple Interior Gateway Protocol (IGP), mainly used in small-sized networks, such as academic networks and simple LANs. RIP is not applicable to complex networks.

RIP is still widely used in practical networking due to easier implementation, configuration and maintenance than OSPF and IS-IS.

2.1.1  RIP Working Mechanism

I. Basic concepts

RIP is a distance vector routing protocol, using UDP packets for exchanging information through port 520.

RIP uses a hop count to measure the distance to a destination. The hop count is known as the metric. The hop count from a router to a directly connected network is 0. The hop count from one router to a directly connected router is 1. To limit convergence time, the range of RIP metric value is from 0 to 15. A metric value of 16 (or bigger) is considered infinite, which means the destination network is unreachable. That is why RIP is not suitable for large-scaled networks.

RIP prevents routing loops by implementing the split horizon and poison reverse functions.

II. RIP routing table

A RIP router has a routing table containing routing entries of all reachable destinations, and each routing entry contains:

l           Destination address: IP address of a host or a network.

l           Next hop: IP address of the adjacent router’s interface to reach the destination.

l           Egress interface: Packet outgoing interface.

l           Metric: Cost from the local router to the destination.

l           Route time: Time elapsed since the routing entry was last updated. The time is reset to 0 every time the routing entry is updated.

l           Route tag: Identifies a route, used in a routing policy to flexibly control routes. For information about routing policy, refer to Routing Policy Configuration.

III. RIP timers

RIP employs four timers, update, timeout, suppress, and garbage-collect.

l           The update timer defines the interval between routing updates.

l           The timeout timer defines the route aging time. If no update for a route is received within the aging time, the metric of the route is set to 16 in the routing table.

l           The suppress timer defines how long a RIP route stays in the suppressed state. When the metric of a route is 16, the route enters the suppressed state. In the suppressed state, only routes which come from the same neighbor and whose metric is less than 16 will be received by the router to replace unreachable routes.

l           The garbage-collect timer defines the interval from when the metric of a route becomes 16 to when it is deleted from the routing table. During the garbage-collect timer length, RIP advertises the route with the routing metric set to 16. If no update is announced for that route after the garbage-collect timer expires, the route will be deleted from the routing table.

IV. Routing loops prevention

RIP is a distance vector (D-V) routing protocol. Since a RIP router advertises its own routing table to neighbors, routing loops may occur.

RIP uses the following mechanisms to prevent routing loops.

l           Counting to infinity. The metric value of 16 is defined as unreachable. When a routing loop occurs, the metric value of the route will increment to 16.

l           Split horizon. A router does not send the routing information learned from a neighbor to the neighbor to prevent routing loops and save bandwidth.

l           Poison reverse. A router sets the metric of routes received from a neighbor to 16 and sends back these routes to the neighbor to help delete useless information from the neighbor’s routing table.

l           Triggered updates. A router advertises updates once the metric of a route is changed rather than after the update period expires to speed up network convergence.

2.1.2  Operation of RIP

The following procedure describes how RIP works.

1)         After RIP is enabled, the router sends Request messages to neighboring routers. Neighboring routers return Response messages including information about their routing tables.

2)         After receiving such information, the router updates its local routing table, and sends triggered update messages to its neighbors. All routers on the network do the same to keep the latest routing information.

3)         By default, a RIP router sends its routing table to neighbors every 30 seconds.

4)         RIP ages out routes by adopting an aging mechanism to keep only valid routes.

2.1.3  RIP Version

RIP has two versions, RIPv1 and RIPv2.

RIPv1, a classful routing protocol, supports message advertisement via broadcast only. RIPv1 protocol messages do not carry mask information, which means it can only recognize routing information of natural networks such as Class A, B, C. That is why RIPv1 does not support discontiguous subnets.

RIPv2 is a classless routing protocol. Compared with RIPv1, RIPv2 has the following advantages.

l           Supporting route tags. Route tags are used in routing policies to flexibly control routes.

l           Supporting masks, route summarization and Classless Inter-Domain Routing (CIDR).

l           Supporting designated next hops to select the best next hops on broadcast networks.

l           Supporting multicast routing update to reduce resource consumption.

l           Supporting plain text authentication and MD5 authentication to enhance security.

 

&  Note:

RIPv2 has two types of message transmission: broadcast and multicast. Multicast is the default type using 224.0.0.9 as the multicast address. The interface working in the RIPv2 broadcast mode can also receive RIPv1 messages.

 

2.1.4  RIP Message Format

I. RIPv1 message format

A RIPv1 message consists of a header and up to 25 route entries.

Figure 2-1 shows the format of RIPv1 message.

Figure 2-1 RIPv1 Message Format

l           Command: Type of message. 1 indicates request, and 2 indicates response.

l           Version: Version of RIP, 0x01 for RIPv1.

l           AFI: Address Family Identifier, 2 for IP.

l           IP Address: Destination IP address of the route. It can be a natural network, subnet or a host address.

l           Metric: Cost of the route.

II. RIPv2 message format

The format of RIPv2 message is similar with RIPv1. Figure 2-2 shows it.

Figure 2-2 RIPv2 Message Format

The differences from RIPv1 are stated as following.

l           Version: Version of RIP. For RIPv2 the value is 0x02.

l           Route Tag: Route Tag.

l           IP Address: Destination IP address. It could be a natural network address, subnet address or host address.

l           Subnet Mask: Mask of the destination address.

l           Next Hop: If set to 0.0.0.0, it indicates that the originator of the route is the best next hop; otherwise it indicates a next hop better than the originator of the route.

III. RIPv2 authentication

RIPv2 sets the AFI field of the first route entry to 0xFFFF to identify authentication information. See Figure 2-3.

Figure 2-3 RIPv2 Authentication Message

l           Authentication Type: 2 represents plain text authentication, while 3 represents MD5.

l           Authentication: Authentication data, including password information when plain text authentication is adopted or including key ID, MD5 authentication data length and sequence number when MD5 authentication is adopted.

 

&  Note:

l      RFC 1723 only defines plain text authentication. For information about MD5 authentication, refer to RFC2082 “RIPv2 MD5 Authentication”.

l      With RIPv1, you can configure the authentication mode in interface view. However, the configuration will not take effect because RIPv1 does not support authentication.

 

2.1.5  Supported RIP Features

The current implementation supports RIPv1 and RIPv2

2.1.6  Protocols and Standards

RFC 1058: Routing Information Protocol

RFC 1723: RIP Version 2 - Carrying Additional Information

RFC 1721: RIP Version 2 Protocol Analysis

RFC 1722: RIP Version 2 Protocol Applicability Statement

RFC 1724: RIP Version 2 MIB Extension

RFC 2082: RIPv2 MD5 Authentication

2.2  Configuring RIP Basic Functions

2.2.1  Configuration Prerequisites

Before configuring RIP basic functions, configure IP addresses for interfaces, making all adjacent nodes reachable to each other at the network layer.

2.2.2  Configuration Procedure

I. Enabling RIP and a RIP interface

Follow these steps to enable RIP:

To do…

Use the command…

Remarks

Enter system view

System-view

––

Enable a RIP process and enter RIP view

rip [ process-id ]

Required

Not enabled by default

Enable RIP on the interface attached to the specified network

network network-address

Required

Disabled by default

 

&  Note:

l      If you make some RIP configurations in interface view before enabling RIP, those configurations will take effect after RIP is enabled.

l      RIP runs only on the interfaces residing on the specified networks. Therefore, you need to specify the network after enabling RIP to validate RIP on a specific interface.

l      You can enable RIP on all interfaces using the command network 0.0.0.0.

 

II. Configuring the interface behavior

Follow these steps to configure the interface behavior:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Disable an or all interfaces from sending routing updates (the interfaces can still receive updates)

silent-interface { all | interface-type interface-number }

Optional

All interfaces can send routing updates by default.

Return to system view

quit

Enter interface view

interface interface-type interface-number

Enable the interface to receive RIP messages

rip input

Optional

Enabled by default

Enable the interface to send RIP messages

rip output

Optional

Enabled by default

 

III. Configuring a RIP version

You can configure a RIP version in RIP or interface view.

l           If neither global nor interface RIP version is configured, the interface sends RIPv1 broadcasts and can receive RIPv1 broadcast and unicast packets, and RIPv2 broadcast, multicast, and unicast packets.

l           If an interface has no RIP version configured, it uses the global RIP version; otherwise it uses the RIP version configured on it.

l           With RIPv1 configured, an interface sends RIPv1 broadcasts, and can receive RIPv1 broadcasts and RIPv1 unicasts.

l           With RIPv2 configured, a multicast interface sends RIPv2 multicasts and can receive RIPv2 unicasts, broadcasts and multicasts.

l           With RIPv2 configured, a broadcast interface sends RIPv2 broadcasts and can receive RIPv1 unicasts, and broadcasts, and RIPv2 broadcasts, multicasts and unicasts.

Follow these steps to configure a RIP version:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Specify a global RIP version

version { 1 | 2 }

Optional

By default, if an interface has a RIP version specified, the version takes precedence over the global one. If no RIP version is specified for an interface, the interface can send RIPv1 broadcasts, and receive RIPv1 broadcasts, unicasts, RIPv2 broadcasts, multicasts and unicasts.

Return to system view

Quit

Enter interface view

interface interface-type interface-number

––

Specify a RIP version for the interface

rip version { 1 | 2 [ broadcast | multicast ] }

Optional

 

2.3  Configuring RIP Route Control

In complex networks, you need to configure advanced RIP features.

This section covers the following topics:

l           Configuring an Additional Routing Metric

l           Configuring RIPv2 Route Summarization

l           Disabling Host Route Reception

l           Advertising a Default Route

l           Configuring Inbound/Outbound Route Filtering

l           Configuring a Priority for RIP

l           Configuring RIP Route Redistribution

Before configuring RIP routing feature, complete the following tasks:

l           Configure an IP address for each interface, and make sure all neighboring routers are reachable to each other.

l           Configure RIP basic functions

2.3.1  Configuring an Additional Routing Metric

An additional routing metric can be added to the metric of an inbound or outbound RIP route.

The outbound additional metric is added to the metric of a sent route, the route’s metric in the routing table is not changed.

The inbound additional metric is added to the metric of a received route before the route is added into the routing table, so the route’s metric is changed.

Follow these steps to configure additional routing metrics:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Enter interface view

interface interface-type interface-number

––

Define an inbound additional routing metric

rip metricin [ route-policy route-policy-name ] value

Optional

0 by default

Define an outbound additional routing metric

rip metricout [ route-policy route-policy-name ] value

Optional

1 by default

 

2.3.2  Configuring RIPv2 Route Summarization

Route summar