12-IPV4 Routing Operation

Download

Table of Contents

Chapter 1 Static Routing Configuration. 1-1

1.1 Introduction. 1-1

1.1.1 Static Routing. 1-1

1.1.2 Default Routes. 1-1

1.1.3 Application of Static Routing. 1-1

1.2 Configuring Static Route. 1-2

1.2.1 Configuration Prerequisites. 1-2

1.2.2 Configuring Static Routes. 1-2

1.3 Displaying and Maintaining Static Routes. 1-3

1.4 Example of Static Routes Configuration. 1-4

Chapter 2 RIP Configuration. 2-1

2.1 RIP Overview. 2-1

2.1.1 RIP Mechanism.. 2-1

2.1.2 RIP Version. 2-3

2.1.3 RIP Message Format 2-4

2.1.4 RIP Feature Supported. 2-5

2.1.5 RIP Related RFC. 2-5

2.2 RIP Basic Configuration. 2-6

2.2.1 Configuring RIP Basic Function. 2-6

2.3 RIP Route Control 2-8

2.3.1 Configuring additional routing metric. 2-8

2.3.2 Configuring route summarization. 2-8

2.3.3 Disabling the receiving of host routes. 2-9

2.3.4 Configuring default route. 2-9

2.3.5 Configuring route filtering. 2-10

2.3.6 Configuring protocol priority. 2-10

2.3.7 Redistributing route. 2-10

2.4 RIP Configuration Optimization. 2-11

2.4.1 Configuring RIP timer 2-11

2.4.2 Configuring split horizon and poison reverse. 2-12

2.4.3 Configuring RIP updating message validation. 2-12

2.4.4 Configuring RIP-2 message authentication. 2-13

2.4.5 Configuring RIP peer 2-13

2.5 Displaying and Maintaining RIP. 2-14

2.6 RIP Configuration Example. 2-15

2.6.1 Configuring RIP Version. 2-15

2.7 Troubleshooting RIP Configuration. 2-17

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 Defining IPv4 Prefix List 3-2

3.3 Configuring a Routing Policy. 3-3

3.3.1 Creating a Routing Policy. 3-4

3.3.2 Defining if-match Clauses for the Routing Policy. 3-4

3.3.3 Defining apply Clauses for the Routing Policy. 3-5

3.4 Displaying and Maintaining the Routing Policy. 3-6

3.5 Routing Policy Configuration Example. 3-6

3.5.1 Applying Routing Policy When Redistributing IPv4 Routes. 3-6

3.6 Troubleshooting Routing Policy Configuration. 3-8

3.6.1 IPv4 Routing Information Filtering Failed. 3-8

 


Chapter 1  Static Routing Configuration

 

&  Note:

A router in this chapter refers to a generic router or a Layer 3 switch running routing protocols. To improve readability, this will not be described in the present manual again.

 

1.1  Introduction

1.1.1  Static Routing

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

The disadvantage of static routing is that, if a fault or a topological change occurs to the network, the route will be unreachable and the network breaks. In this case, the network administrator has to modify the configuration manually.

1.1.2  Default Routes

A default route is a special static route.

Generally, a router selects the default route only when it cannot find any matching entry in the routing table. 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 check whether a default route has been configured by running the display ip routing-table command.

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 is not in the routing table, the packet will be discarded and an ICMP packet is sent to the source reporting that the destination or the network is unreachable.

1.1.3  Application of Static Routing

You need to be familiar with the following contents while configuring static routes:

1)         Destination address and masks

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

2)         Output interface and the next hop address

While configuring static routes, you can specify either the output interface or next hop address. Whether you should specify the output interface or the next hop address depends on the specific occasion.

In fact, all the route entries must specify the next hop address. While forwarding a packet, the corresponding route is determined by searching the routing table for the packet’s destination address. Only after the next hop address is specified, the corresponding link-layer address can be found for the link-layer to forward the packet.

3)         Other attributes

You can configure different preferences for different static routes for the purpose of easy routing management policy. For example, while configuring multiple routes to the same destination, using identical preference allows for load sharing while using different preference allows for routing backup.

 

&  Note:

S5500-SI series do not support load sharing.

 

1.2  Configuring Static Route

1.2.1  Configuration Prerequisites

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

l           Configuring the physical parameters for relative interfaces

l           Configuring the link-layer attribute for relative interfaces

l           Configuring the IP address for relative interfaces

1.2.2  Configuring Static Routes

Follow these steps to configure a static route:

Operation

Command

Description

Enter system view

system-view

Configure a static route

ip route-static ip-address { mask | mask-length } { [ vlan-interface vlan-id ] nexthop-address | NULL interface-number } [ preference preference | description description-info | tag tag-value ]*

Required

Configure the default preference for a static route

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

Optional

The preference is 60 by default.

 

&  Note:

l      While configuring a static route, it will use the default preference if no value is specified. After resetting the default preference, it is valid only for the newly created static route.

l      The description text can describe the usage and function of some specific routes, thus make it easy for you to classify and manage different static routes.

l      You can easily control the routes by using the tag set in the routing policy.

l      While running the ip route-static command to configure static, configuring all-zero destination address and mask specifies using the default route.

 

1.3  Displaying and Maintaining Static Routes

After the configuration, you can run the display command in any view to display the running status and configuration effect of the static route configuration.

You can use the delete command in the system view to delete all the static routes configured.

Follow these steps to display and maintain a static route:

Operation

Command

Display the summary of the IP routing table

display ip routing-table

Display the details of the IP routing table

display ip routing-table verbose

Display the information of a static route

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

Delete all static routes

delete static-routes all

 

&  Note:

You can use the undo ip route-static demand in the system view to delete a static route, and use the delete state-routes all demand in the system view to delete all the static routes configured (including the default IPv4 routes configured manually) at the same time.

 

1.4  Example of Static Routes Configuration

I. Network requirements

The switches’ interfaces and the hosts’ IP addresses and masks are shown in the following figure. It requires static routes to connect the hosts for inter-communication.

II. Network diagram

Figure 1-1 Network diagram for static routes

III. Configuration procedure

1)         Configuring the interfaces’ IP addresses

Omitted.

2)         Configuring the static route

# Configure a default route on SwitchA.

<SwitchA> system-view

[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2

# Configure two static routes on SwitchB.

<SwitchB> system-view

[SwitchB] ip route-static 1.1.1.0 255.255.255.0 1.1.4.1

[SwitchB] ip route-static 1.1.3.0 255.255.255.0 1.1.4.6

# Configure a default route on SwitchC.

[Switch B<SwitchC> system-view

[SwitchC] ip route-static 0.0.0.0 0.0.0.0 1.1.4.5

3)         Configure the hosts

The default gateways for the three hosts PC1, PC2 and PC3 are configured as 1.1.1.1, 1.1.2.1 and 1.1.3.1 respectively.

4)         Display the configuration result

# Display the IP route table of SwitchA.

[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         Vlan100

1.1.1.0/24          Direct 0    0            1.1.1.1         Vlan200

1.1.1.1/32          Direct 0    0            127.0.0.1       InLoop0

1.1.4.0/30          Direct 0    0            1.1.4.1         Vlan100

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

# Use the ping command to check the connectivity.

[SwitchA] ping 1.1.3.1

  PING 1.1.3.1: 56  data bytes, press CTRL_C to break

    Reply from 1.1.3.1: bytes=56 Sequence=1 ttl=254 time=62 ms

    Reply from 1.1.3.1: bytes=56 Sequence=2 ttl=254 time=63 ms

    Reply from 1.1.3.1: bytes=56 Sequence=3 ttl=254 time=63 ms

    Reply from 1.1.3.1: bytes=56 Sequence=4 ttl=254 time=62 ms

    Reply from 1.1.3.1: bytes=56 Sequence=5 ttl=254 time=62 ms

 

  --- 1.1.3.1 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 62/62/63 ms

 

# Use the tracert command to check the connectivity.

[SwitchA] tracert 1.1.3.1

 traceroute to  1.1.3.1(1.1.3.1) 30 hops max,40 bytes packet, press CTRL_C to break

 1 1.1.4.2 31 ms  32 ms  31 ms

 2 1.1.4.6 62 ms  63 ms  62 ms

 


Chapter 2  RIP Configuration

 

&  Note:

The term "router" in this document refers to a router in a generic sense or a Layer 3 switch. To improve readability, this will not be described in the present manual again.

 

2.1  RIP Overview

RIP is a simple Interior Gateway Protocol (IGP), which is mainly used in small-size networks, such as academic networks and simple structured LANs.

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

2.1.1  RIP Mechanism

I. Basic concept of RIP

RIP is a distance-vector-based routing protocol, using UDP messages for exchanging information on port 520.

RIP uses a routing metric (Hop Count) to measure the distance to the destination. The Hop Count value of a router to its directly connected network is 0. Networks which are reachable through one other router are one hop etc. To reduce the convergence time, RIP limits the metric value from 0 to 15. It is considered infinity if the value is equal or larger than 16, which means the destination network is unreachable. That is why RIP cannot be used in large scale networks.

RIP prevents routing loops by implementing Split Horizon and Poison Reverse functions.

II. RIP routing table

Each RIP router has a routing table, containing routing entries of all reachable destinations.

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

l           Next hop: IP address of the adjacent router to the destination network.

l           Interface: The interface for forwarding

l           Metric: Cost from the local router to the destination

l           Routing time: The amount of time since the entry was last updated. The time is reset to 0 when the routing entry is updated every time.

l           Route change tag: Indicates that the information about this route has changed.

III. RIP timers

RIP uses four timers to control its operation. They are Update, Timeout, Suppress, and Garbage-Collect.

l           Update timer triggers sending new update messages periodically.

l           Timeout timer controls the validity of a route. A route is considered as unreachable when the RIP router does not receive update messages within the aged time from any neighbor.

l           Suppress timer. A route changes to the suppress status when no updated messages are send within the timeout-value or the metric value reaches 16. In the suppress status, the router only accepts update messages with the metric value less than 16 and from the same neighbor to replace the unreachable route.

l           Garbage-Collect timer. The period from the metric value of a route reaches 16 to the route is purged from the table is defined as the garbage collection time in RFC. During the Garbage-Collect time, RIP keeps advertising the route with a metric value of 16. Once the Garbage-Collect time expires and the route is not updated, the route is deleted from the table.

IV. RIP initialization and running procedure

Following procedures describe how RIP works.

1)         After enabling RIP, the router sends Request messages to neighboring routers. Neighboring routers return Response messages including all information about the routing table.

2)         The router updates its local routing table, and broadcasts the routing updates to its neighbors with triggered updating messages. All routers on the network do the same to keep the latest routing table.

In RIP, the routing table on each router is updated upon receipt of RIP messages periodically advertised by neighboring routers. The aged routes are deleted to make sure routes are always valid. The procedure is as follows: RIP periodically advertises the local routing table to neighboring routers, which update their local routes upon receipt of the packets. This procedure repeats on all RIP-enabled routers.

V. Routing loops prevention

RIP is a D-V based routing protocol. Each router calculates the distance to a destination based on the routing information from its neighbors. When a connection to a destination goes down, there is no way for the router on that connection to notify the others about its metric changes. The other routers still use the old routing information to calculate the distance to that destination. Therefore, routing loops can occur in this case.

RIP uses the following mechanisms to prevent routing loops.

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

l           Split Horizon. The router does not send the routing table to neighboring routers via the same interface on which it receives. Split Horizon can definitely prevent routing loops and save the bandwidth.

l           Poison Reverse. The router sends routing tables through the same interface from which the tables are received with a metric value of 16 (means infinite). This method can remove useless information in routing tables of neighboring routers.

l           Triggered Updates. Each router sends out its new routing table as long as it receives an update, rather than waiting until the usual update period expires. This can speed up the network convergence.

2.1.2  RIP Version

RIP has two versions: RIP-1 and RIP-2.

RIP-1, a Classful Routing Protocol, supports broadcasting protocol messages. RIP-1 protocol messages do not carry mask information, which means it can only recognize routing information on segments with natural addresses such as Class A, B, and C. That is why RIP-1 does not support routing convergence and Discontiguous Subnet.

RIP-2 is a Classless Routing Protocol. Compared with RIP-1, RIP-2 has the following advantages.

l           Supports Route Tag. The Route Tag is intended to differentiate the internal RIP routes from the external RIP routes.

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

l           Supports next hop, which must be directly reachable on the broadcast network.

l           Supports multicasting to reduce unnecessary load on hosts that do not need to listen to RIP-2 messages.

l           Supports authentication to enhance security. Plain text authentication and MD5 (Message Digest 5) are two authentication methods.

 

&  Note:

RIP-2 has two types of message transmission: broadcasting and multicasting. Multicasting is the default type using 224.0.0.9 as the multicast address. The interfaces running RIP-2 broadcasting can also receive RIP-1 messages.

 

2.1.3  RIP Message Format

I. RIP-1 message format

A RIP message consists of Header and Route Entries which can be up to 25.

The format of RIP-1 message is shown in Figure 2-1.

Figure 2-1 RIP-1 Message Format

l           Command: The type of message. 1 indicates Request, 2 indicates Response.

l           Version: The version of RIP. RIP-1 is 0x01.

l           AFI (Address Family Identifier): The family of protocol. 2 is for IP.

l           IP Address: IP address of the destination. Only natural addresses are acceptable here.

l           Metric: The cost of the route.

II. RIP-2 message format

The format of RIP-2 message is similar with RIP-1. Figure 2-2 shows it.

Figure 2-2 RIP-2 Message Format

The differences from RIP-1 are stated as following.

l           Version: The version of RIP. For RIP-2 the value is 0x02.

l           Route Tag: An attribution to indicate from where the routes are imported.

l           IP Address: The destination IP address. It could be a natural address, subnet address or host address.

l           Subnet Mask: Mask of the destination address.

l           Next Hop: The address of the best next hop. 0.0.0.0 indicates that the originator of the route is the best next hop.

III. RIP-2 authentication

RIP-2 supports plain text authentication, which uses the first Route Entry for authentication. The value of 0xFFFF indicates that the entry is authentication information rather than routing information. See Figure 2-3

Figure 2-3 RIP-2 Authentication Message

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

l           Authentication: The actual authentication data. It includes the password information when using plain text authentication.

 

&  Note:

RFC 1723 only defines plain text authentication. For information about MD5 authentication, see RFC2082 “RIP-2 MD5 Authentication”.

 

2.1.4  RIP Feature Supported

Currently, S5500-SI Series Ethernet Switches support the following RIP features.

l           RIP-1

l           RIP-2

2.1.5  RIP Related RFC

l           RFC 1058: Routing Information Protocol

l           RFC 1723: RIP Version 2 - Carrying Additional Information

l           RFC 1721: RIP Version 2 Protocol Analysis

l           RFC 1722: RIP Version 2 Protocol Applicability Statement

l           RFC 1724: RIP Version 2 MIB Extension

l           RFC 2082: RIP-2 MD5 Authentication

2.2  RIP Basic Configuration

Before configuring RIP features, please first configure IP address on each interface, and make sure all routers are reachable.

2.2.1  Configuring RIP Basic Function

I. Enabling RIP and specify networks

Follow these steps to enable RIP:

Operation

Command

Description

Enter system view

system-view

––

Enable RIP and enter RIP view

rip [ process-id ]

––

Enable RIP on specified network

network network-address

Required

Disabled by default

 

&  Note:

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

l      The router does not send, receive or forward any routing information if you do not enable RIP on that network.

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

 

II. Configuring the interface behavior

Follow these steps to configure interface behavior:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Stop routing updates on interfaces

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

Optional

All interfaces can receive routing updates by default

Return to system view

quit

––

Enter interface view

interface interface-type interface-number

––

Configure an interface to receive routing updates

rip input

Optional

By default, the router receives and send RIP messages

Configure an interface to send routing updates

rip output

 

&  Note:

Stopping routing updates means that the router receives routing updates without forwarding them.

 

III. Configuring the RIP version

Follow these steps to configure the RIP version:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Specify a global RIP version

version { 1 | 2 }

Optional

RIP-1 by default

Return to system view

quit

––

Enter interface view

interface interface-type interface-number

––

Specify a RIP version on the interface

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

Optional

By default, the router receives RIP-1 and RIP-2 messages, but only sends RIP-1 messages. If the RIP version is 2, you can specify the message is broadcast or multicast.

 

&  Note:

If the RIP version specified on the interface and the global RIP version are inconsistent, the RIP version specified on the interface is used.

If no RIP version is specified on the interface, the global RIP version is used.

 

2.3  RIP Route Control

In some complex network environments, you need to make the RIP configuration more precise.

Before configuring RIP routing information, finish the following tasks first:

l           Configure IP address on each interface, and make sure all routers are reachable.

l           Configure basic RIP functions

2.3.1  Configuring additional routing metric

To increase the value of routing metrics, you can add a value to the incoming or outgoing routing metric learned by RIP.

Follow these steps to configure additional routing metrics:

Operation

Command

Description

Enter system view

system-view

––

Enter interface view

interface interface-type interface-number

––

Define an additional routing metric for incoming routes

rip metricin value

Optional

0 by default

Define an additional routing metric for outgoing routes

rip metricout value

Optional

1 by default

 

&  Note:

rip metricout is only applied to its own routing and those learned by RIP. For those imported from other routing protocols, this command is not applicable.

 

2.3.2  Configuring route summarization

The route summarization is that subnet routes in a natural network are summarized until the whole network is advertised as a single natural mask route. This function can reduce the size of the routing tables so that to reduce the network load.

RIP-1 does not support route summarization. So when RIP-2 is running, you need to disable the route summarization function if you want to advertise all subnet routes.

I. Enable RIP-2 automatic route summarization

Follow these steps to configure RIP route summarization:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Enable RIP-2 automatic route summarization

summary

Optional

Enabled by default

 

II. Assign a summary IP address

Follow these steps to assign a summary IP address:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Disable RIP-2 automatic route summarization

undo summary

Optional

Enabled by default

Return to system view

quit

––

Enter interface view

interface interface-type interface-number

––

Assign an IP address and network mask for the summarized routes to be advertised

rip summary-address ip-address network-{ mask | mask-length }

Optional

 

2.3.3  Disabling the receiving of host routes

In some cases, the router can get lots of routing information from the same network hosts, which are not helpful for routing but taking large of the network resources. After disabling the host route function, the router discards the host route information.

Follow these steps to configure host route:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Disabling the receiving of host routes

undo host-route

Optional

Enabled by default

 

2.3.4  Configuring default route

Follow these steps to configure RIP default route:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Configure a RIP default route

default-route originate cost value

Required

 

2.3.5  Configuring route filtering

Route filtering is supported by the router. You can filter incoming and outgoing routes by setting the inbound and outbound filter policies in the access list and IP address prefixes list. You can also specify the incoming routes from particular neighbors.

Follow these steps to configure route filtering:

Operation

Command

Description

Enter system view

system-view

––

Enter RIP view

rip [ process-id ]

––

Define the filtering policy

filter-policy { acl-number | [ ip-prefix ip-prefix-name ][ gateway ip-prefix-name ] | gateway ip-prefix-name } import [ interface-type interface-number ]

Required

Define the filtering policy for the redistributed route