RIP Routing Agreement Quick Start

xiaoxiao2021-03-06  105

The work of the router is nothing more than two, one is the path selection, the second is the data forwarding. The data forwarding is relatively easy, it is difficult to determine the best path to the destination network. Therefore, the path selection has become the most important work of the router. Many routing protocols can complete the work of path selection, common with RIP, OSPF, IGRP, and EIGRP protocols, etc. In these algorithms, we can't say anyone who is bad, because the algorithm is determined by the environment. For example, the RIP protocol, it sometimes does not accurately select the optimal path, and the convergence time is slightly longer, but for small-scale, there is no network maintained network, it is the preferred routing protocol, we look Is its simplicity.

If you have a small network project, then let us arrange a plan, read this article in 30 minutes (one reading), 20 minutes, then see the command and operation method mentioned in this article (Second Reading), Configure all routers on the network (small network, without several routers), check the network work normally. Ok, one hundred minutes, your RIP network is running. It's so simple, don't believe, please continue to look down.

First, what is RIP?

RIP (Routing Information Protocols, Routing Information Protocol) is the most wide range of distance vector protocols, which is developed by Xerox in the 1970s. At that time, RIP was part of the XNS (Xerox Network Service, Xerox Network Services) protocol cluster. The TCP / IP version of RIP is an improvement version of the Xerox Agreement. The biggest feature of RIP is that regardless of the principle or configuration method, it is very simple.

Measurement method

RIP's measure is based on hop count, and each router is passed by a router. In this way, the more hops, the longer the path, the RIP algorithm will give priority to the path of less hops. The maximum number of hops supported by RIP is 15, and the network with a number of hops is considered to be unreachable.

Routing update

The update of the RIP is implemented by Timed Broadcasting. By default, the router broadcasts your routing table every 30 seconds to its network, and the router connected to the broadcast will add the received information to its own routing table. Each router is so broadcast, and all routers on the final network will know all routing information. Under normal circumstances, the router can be received every 30 seconds to confirm that if there is 180 seconds, that is, 6 update cycles, a routing item is not confirmed, and the router considers that it has been invalid. If you have passed 240 seconds, that is, 8 update cycles, routing items still have not been confirmed, it is removed from the routing table. The delay in the above 30 seconds, 180 seconds and 240 seconds is controlled by the timer, which is an update timer, an invalid timer, and a Flush Timer.

Routing cycle

The algorithm of the distance vector is easy to generate a routing cycle, and the RIP is one of the distance vector algorithm, so it is no exception. If there is a routing loop on the network, the information will be looped, never reach the destination. In order to avoid this problem, the RIP equivalent to the distance vector algorithm achieves the following four mechanisms.

Horizontal segmentation (Split Horizon). Horizontal segmentation ensures that the router remembers the source of each routing message and does not send it again on the port that receives this information. This is to ensure that the most basic measures do not produce routing cycles. Toxic reversal (Poison Reverse). When a path information becomes invalid, the router does not immediately remove it from the routing table, but uses 16, that is, the measured metric will be broadcast out. This has increased the size of the routing table, but it is very helpful to the elimination routing loop, which can immediately clear any loop between adjacent routers.

Trigger Update. When the routing table changes, the update message is broadcast immediately to the adjacent routers, rather than waiting for a 30 second update period. Similarly, it broadcasts the request message when a router just starts RIP. Adjacent routers that receive this broadcast immediately respond to a update message without having to wait until the next update cycle. In this way, the change in the network topology will be quickly transmitted on the network, reducing the possibility of routing cycles.

Suppression Timer (Holddown Timer). After a routing information is invalid, this route is in a suppression state, ie no longer receives routing updates about the address of the same destination within a certain period of time. If the router knows a path failure from a network segment, then immediately learn this route is valid on another network segment. This effective information is often incorrect, suppressing the timing to avoid this problem, and when a link is frequently stopped, suppression timing reduces the floating of the route, increasing the stability of the network.

Even if the above four methods are used, the problem of routing cycles cannot be completely solved, but it is just a maximum reduction. Once the routing cycle really appears, the measure value of the routing item will appear to the count to infinity. This is because routing information is passed, each passing a router, adding a metric to add 1, which is added to 16, and the path is unreachable. RIP selection 16 is very clever, it is high enough, it is guaranteed that most networks can run normally, which is small enough to make the count to infinity cost. The shortest time.

neighbor

Some networks are NBMA (Non-Broadcast Multiaccess, non-broadcast multi-channel access), that is, broadcast transmission data is not allowed on the network. For this network, RIP cannot rely on the broadcast route table. There are many solutions, the simplest is to specify neighbor, which specifies to send routing tables to a particular router.

RIP defect

Although RIP is simple, it has a long-term test, but there are some important defects, mainly with the following points: too simple, based on the calculation metrics, often draw non-optimal routes; metrics 16 is limited, not suitable for large networks; security is poor, accept route updates from any device; no IP address and VLSM (Variable Length Subnet Mask, becoming long network mask); slow convergence, time is often greater than 5 minutes The consumption bandwidth is very large.

Second, how to match the router

The router itself is a computer with multiple network interfaces. Like a normal computer, it also has a central processor (CPU), system main memory (RAM), and read-only memory (ROM).

In addition, a very important part is its network interface, in order to link different types of networks, the router has a wide variety of network interfaces, such as the application in the local area, fast Ethernet, token ring, application The V.35, RS232, ISDN Bri PRI interface of the WAN, etc. There are two main memory of the router: NVRAM (Non-Volatile Ram, Non-Volatile RAM) and Flash (flash). NVRAM stores the configuration file of the router, Flash is used to store the operating system iOS (Internet Operating System). Configuration mode

There are two of the most basic configuration modes of the Cisco router: users (users) and privileged. In user mode, only the status of the router can be displayed, and the privilege mode can also change the router configuration.

In the privileged mode, you can enter the installation (SETUP) mode, a global config mode, a Sub Config mode. The installation mode provides a menu prompt to boot the user's basic configuration of the router. After the new router is started for the first time, the installation mode is automatically entered.

The global parameters of the router can be changed in the global configuration mode, such as host names, passwords, and more. Partial configuration changes the local parameters of the router, such as a configuration of a network interface, a configuration of a routing protocol, and more.

Configuration method

The configuration of the router can use a variety of ways, the five are the most common: Use the Terminal class to log in to the console through the serial port. Connect the modem to the Auxiliary Port, a remote dial-up login console. Remote login (Telnet) to a router's IP address, access the router through the Vty (Virtue Terminal Line, Virtual Terminal). Edit the configuration file and upload it to the router via TFTP. The router parameters are set remotely through the Network Management Software (Network Management System).

Install the router

Suppose only three routers in our project network. They are placed in Beijing, Shanghai and Tianjin, named Testbj, Testsh, and Testtj, respectively. We use C to reserve IP address 172.16.0.0, a total of four subnets 172.16.1.0, 172.16.2.0, 172.16.3.0 and 172.16.4.0, and subnet mask are all 255.255.255.0. basic configuration

Connect the serial cable included in the package to the console port of the beijing router, and the other end is connected to the computer's COM port. Start the super terminal program (in Win95 / NT), make appropriate configuration, connect the router. Power supply to the router, in a row, the following prompt appears, and the router is displayed in user mode.

Testbj>

Transferred by user mode to privilege mode, use enable commands.

Testbj> enable

Testbj #

Like UNIX hosts, "#" represents the system prompt of the privilege (root) user, indicating that you entered the privileged mode. In contrast to the Enable, the command returns the user mode from the privileged mode is disable.

In privileged mode, you can use the config terminal command to enter the global configuration mode. In Global Configuration Mode, you can use some names of the configuration subkey to enter the local configuration mode. The returned method is an exit command. Among them, the command directly returns the privilege mode from the local configuration mode is END. As follows. Testbj # config Terminal

ENTER Configuration Commands, One Per Line. End with CNTL / Z.

Testbj (config) #Router Rip

Testbj (config-router) #exit

Testbj (config) #exit

Testbj #

A very distracted feature of Cisco iOS is its command line help, one? Solved all questions. ? You can display the list of commands in the current mode, you can display the full name of the command, and you can display the parameters and help information of the command. Type anywate to command uncertainty? The system will give a message.

The Cisco router also supports the command-written feature, as long as it does not cause ambiguity, can replace the entire command with the first few characters of the command, so that the type of typing work when configuration is small.

All configuration information of the router is saved in the configuration file. The configuration file currently being used is Running-config, which is stored in system memory, and we will immediately reflect the configured modification in privileged mode. Startup-config is a configuration file stored in NVRAM. Only it is not lost, so if you want to make the modified to the next startup, you must save the current configuration. The storage command is as follows:

Testbj # Copy Running-Config Startup-Config

Building configuration ...

[Ok]

Testbj #

Changing the router name, the name of the password router can be modified by the hostname command.

Router (config) #hostname testbj

Testbj (config) #

The enable password and enable secret commands can modify the password of the privilege mode.

Testbj (config) #ENABLE Password Cisco

Testbj (config) #ENABLE SecR Cisco

Enter the Line Console Local Configuration mode to modify the console login password; enter the Line Vty part configuration mode to modify the password login from the Telnet. The login command pointed out that commands that need to be logged in and modify the password are Password.

Testbj (config) #LINE Console 0

Testbj (Config-line) #login

Testbj (config-line) #password cisco

Testbj (config-line) #exit

Testbj (config) #line vty 0 4

Testbj (Config-line) #login

Testbj (config-line) #password cisco

Test connectivity

Open the remaining two routers, configure it according to the above method, and then check if they are connected.

There are three ways to test line connectivity, ping, traceroute and telnet. Ping can detect whether the destination can be reached; Trace not only detects connectivity, but also gives the path to the destination; Telnet tests the connectivity of the application layer software, as shown below.

Testbj # ping 172.16.4.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP echos to 172.16.4.2, timeout is 2 seconds:

!!!!!

Success Rate IS 100 Percent (5/5) Round-Trip Min / Avg / Max = 24/25/28 mstestbj # Traceroute 172.16.4.2

Type escape sequence to abort.

Tracing the route to 172.16.4.2

1 172.16.2.2 16 MSEC 16 msec *

Testbj # telnet 172.16.4.2

Trying 172.16.4.2 ... Open

User Access Verification

PASSWORD:

TESTTJ>

172.16.4.2 is a port on the router Testtj, and we run the above three commands on Testbj, and we know that it is operating normally.

Show current status

In order for network administrators to easily understand the status of the router, the Cisco router provides a wealth of show commands. We introduce the easiest way here, as shown below.

The show version command displays the hard software version number and configuration information of the router.

Show flash: The command is equivalent to the DIR command of the DOS to display the file information contained in the Flash.

The show interface command displays the status of the network interface.

In the process of configuring the router, the most important show command is to view the contents of the configuration file, you can use the show command to see Running-Config or Startup-Config, as shown below.

Show running-config

Show startup-config

The configuration file is a text file that contains each configuration command you typed. You can download the configuration file to your computer, and then pass the router after modifying the text editor.

Third, what is RIP?

IP address configuration

We can use the interface command to enter the local configuration mode and then use the IP address to set the IP address of the interface. As follows.

Testbj # conf T

ENTER Configuration Commands, One Per Line. End with CNTL / Z.

Testbj (config) #interface E0 / 1

Testbj (Config-IF) #ip address 172.16.1.2 255.255.255.0

Testbj (config-if) #

For ease of configuration and memory, you can add some description information to each port. As shown below, use the description command in port partial configuration mode.

Testbj (config-if) #description connect to testsh

Testbj (Config-IF) #end

Testbj #

Some networks are NBMA (Non-Broadcast Multiaccess, non-broadcast multi-channel access), that is, broadcast transmission data is not allowed on the network. For this network, RIP cannot rely on the broadcast route table. There are many solutions, the simplest is to specify neighbor, which specifies to send routing tables to a particular router.

Some networks are NBMA (Non-Broadcast Multiaccess, non-broadcast multi-channel access), that is, broadcast transmission data is not allowed on the network. For this network, RIP cannot rely on the broadcast route table. There are many solutions, the simplest is to specify neighbor, which specifies to send routing tables to a particular router.

RIP configuration

RIP is the easiest routing protocol. Configuring it only two steps, first, specify the use of the RIP protocol, then declare the connected network number, as shown below.

Testbj (config) #Router Rip

Testbj (config-router) #Network 172.16.0.0testbj (config-router) #end

Testbj #

The router rip command is used to specify the RIP protocol, the network command declaration the network number, because the RIP is a class routing protocol, so you don't have to declare each subnet number.

Repeat the above operations for each router, a network that uses RIP routing is built.

Test configuration correctness

After configuring the RIP, check if the data can be properly routed. In addition to the connection test tools mentioned above, there are several commands: SH IP Route is used to detect routing tables; SH IP protocols are used to check the routing protocol status; Debug IP RIP is used to debug RIP protocol information.

Use the SH IP Route command to display the routing table of each router.

Testbj # Sh IP Route

CODES: C - Connected, S - Static, i - IGRP, R - RIP, M - Mobile, B - BGP

D - EIGRP, EX - EIGRP EXTERNAL, O - OSPF, IA - OSPF Inter area

N1 - OSPF NSSA EXTERNAL TYPE 1, N2 - OSPF NSSA EXTERNAL TYPE 2

E1 - OSPF EXTERNAL TYPE 1, E2 - OSPF External Type 2, E - EGP

I - IS-IS, L1 - IS-IS Level-1, L2 - IS-IS Level-2,

* - Candidate Default, U - Per-User Static Route, O - ODR

Gateway of Last Resort Is Not Set

172.16.0.0/24 is Subnetted, 4 Subnets

R 172.16.4.0 [120/1] VIA 172.16.2.2, 00:00:12, Serial1 / 0

C 172.16.1.0 Is Directly Connected, Ethernet0 / 1

C 172.16.2.0 is Directly Connected, Serial1 / 0

R 172.16.3.0 [120/1] VIA 172.16.1.3, 00:00:09, Ethernet0 / 1

[120/1] VIA 172.16.2.2, 00:00:22, Serial1 / 0

The routing information of the Beijing router is shown above. The letter C starts to connect directly, 172.16.1.0 and 172.16.2.0 are connected to E0 / 1 and S1 / 0 ports, respectively. The RIP protocol learned by the RIP protocol is 172.16.3.0 and 172.16.4.0, where there are two paths to choose from the TestSh and Testtttj routers, to 172.16.3.0. Comparing network topology, it can be seen that the actual situation is exactly the same as the design. The content in the middle bracket is the management distance and metric of the routing term. The default management distance of RIP is 120. The metric value of the 3,4 subnet is 1, that is, one router is up to.

The same command runs on the other two routers, as follows.

Testsh # sh ip route

Gateway of Last Resort Is Not Set

172.16.0.0/24 is Subnetted, 4 Subnets

R 172.16.4.0 [120/1] VIA 172.16.3.2, 00:00:13, Ethernet0 / 0

C 172.16.1.0 Is Directly Connected, Ethernet0 / 1

R 172.16.2.0 [120/1] VIA 172.16.1.2, 00:00:11, Ethernet0 / 1

[120/1] VIA 172.16.3.2, 00:00:13, Ethernet0 / 0c 172.16.3.0 is Directly Connected, Ethernet0 / 0

Testtj # sh ip route

Gateway of Last Resort Is Not Set

172.16.0.0/24 is Subnetted, 4 Subnets

C 172.16.4.0 Is Directly Connected, Ethernet0 / 0

R 172.16.1.0 [120/1] VIA 172.16.3.3, 00:00:07, Ethernet0 / 1

[120/1] VIA 172.16.2.3, 00:00:19, Serial1 / 0

C 172.16.2.0 is Directly Connected, Serial1 / 0

C 172.16.3.0 Is Directly Connected, Ethernet0 / 1

When analyzing the above command, be sure to refer to the topology map, leave the network topology, and there is no meaning. Dynamic routing flexibility is reflected in a link failure, and the routing algorithm will automatically switch to the roundabout. For example, we use the serial cable between Testbj and TestTj. After a while, check the routing table, as shown below.

Testbj # Sh IP Route

Gateway of Last Resort Is Not Set

172.16.0.0/24 IS SUBNETTED, 3 SUBNETS

R 172.16.4.0 [120/2] VIA 172.16.1.3, 00:00:22, Ethernet0 / 1 C 172.16.1.0 is Directly Connected, Ethernet0 / 1

R 172.16.3.0 [120/1] VIA 172.16.1.3, 00:00:22, ethernet0 / 1 We found that the subnet 2 in the serial link is disconnected, and the packets of the network 172.16.4.0 will be around Testsh router.

The SH IP protocols command can display the status of the current routing protocol, as shown below.

Testbj # SH IP Protocols

Routing Protocol Is "RIP"

Sending Updates Every 30 Seconds, Next Due in 19 SECONDS

InvalidAfter 180 Seconds, Hold Down 180, Flushed After 240

Outgoing Update Filter List for All Interfaces IS Not Set

Incoming Update Filter List for All Interfaces Is Not Set

Redistributing: Connected, RIP

Default Version Control: Send Version 1, Receive Any Version

Interface Send Recv Key-Chain

Ethernet0 / 1 1 1 2

Serial1 / 0 1 1 2

Routing for networks:

172.16.0.0

Routing Information Sources:

Gateway Distance last Update

172.16.2.2 120 00:00:05

172.16.1.3 120 00:00:27

Distance: (Default IS 120)

From the command output, it can be seen that the basic configuration of the RIP protocol can also be learned that the router with the current router exchange information has two routers with TESTTJ (172.16.2.2) and TestSH (172.16.1.3). The last received routing information is Before 5 seconds and 27 seconds. To understand the details of the swap routing information between the routers, you can use the debug ip rip command. As shown below, after entering the command, information receiving or transmitting RIP broadcasts appears over a period of time.

Testbj # debug ip rip

Rip protocol debugging is on

Testbj #

Rip: Received V1 Update from 172.16.2.2 on Serial1 / 0

172.16.4.0 in 1 HOPS

172.16.3.0 in 1 HOPS

Rip: received v1 update from 172.16.1.3 on ethernet0 / 1

172.16.4.0 in 2 HOPS

172.16.3.0 in 1 HOPS

Rip: Sending V1 Update to 255.255.255.255 via Ethernet0 / 1 (172.16.1.2) Subnet 172.16.4.0, Metric 2

Subnet 172.16.2.0, metric

1

Rip: Sending V1 Update to 255.255.255.255 via Serial1 / 0 (172.16.2.3)

Subnet 172.16.1.0, Metric 1

Rip: received v1 update from 172.16.1.3 on ethernet0 / 1

172.16.4.0 in 2 HOPS

172.16.3.0 in 1 HOPS

Rip: Received V1 Update from 172.16.2.2 on Serial1 / 0

172.16.4.0 in 1 HOPS

172.16.3.0 in 1 HOPS

Testbj # no debug all

All Possible Debugging Has Been Turned Off

Testbj #

Details of RIP broadcasts can be obtained from the above information. The router first receives information from the subnet 3, 4 from TESTTJ, and then receives information from TestSh from TestSh. Among them, go to subnet 4 walking TestTj, walking TestSh two hops, so the routing table is reflected in the subnet 4; the distance to subnet 3 is a hop, so there are two in the routing table. The routing of strips.

After a period of time, the current router update time has reached 30 seconds, so it broadcasts its own routing information on both links. Note that when the broadcast routing is updated, the RIP uses a horizontal segmentation mechanism. The information from a port is not broadcast on this port, so the current router TestBj transmits only the routing information of the subnet 172.16.1.0.

Use the no debug all command to end the display of the debug information. It should be noted that the debug command is very consumed by router resources, so don't use it on a busy router, otherwise, the router will stop the reaction like a crash.

How, how much time you look at this article. Below you can find a few routers, try configured, not very difficult.

转载请注明原文地址:https://www.9cbs.com/read-124681.html

New Post(0)