Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The difference between experimental design and troubleshooting part II: RIPI and II

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

I. dynamic routing

Dynamic routing protocols have many advantages such as flexibility, but they also have disadvantages, such as occupying extra bandwidth and high CPU load.

Administrative distance (Administrative Distances): a number between 0 and 255. it represents the credibility value of a routing information source. The lower the value, the higher the level of credibility. 0 is the most trusted and 255 is the least trusted. That is, if there is no traffic from this line, there will be no traffic.

If a router receives two routing updates from the remote end, the router will check the administrative distance, and those with low administrative distance will be selected as new routes and stored in the routing table; if they have the same administrative distance, their degrees (Metric) will be compared. Low-degree lines will be used as new lines; if they have the same administrative distance and degree, the load will be balanced on two lines.

Default administrative distance for some common routing protocols:

L directly connected: 0

L static route: 1

L EIGRP:90

L IGRP:100

L OSPF:110

L RIP:120

Note: if you configure static routes on 1 line and RIP, the router will only use static routes by default, because the administrative distance of static routes is 1 less than the administrative distance of RIP.

Three routing protocols:

Distance vector (Distance Vector)

Link State (Link State)

Hybrid (Hybrid)

Distance vector: used to determine the best path according to the distance (Distance). When a packet passes through a router, it is called a hop, and the one with the least hop is regarded as the best path. Such protocols include RIP and IGRP.

Link state: also known as the shortest path first (Shortest-Path-First) protocol. Each router creates three separate tables, one is used to track the neighboring routers directly connected to it, one is used to determine the entire topology of the network, and the other is used as the routing table, so this protocol knows more about the network than the distance vector, and this kind of protocol has OSPF.

Hybrid: combining the characteristics of the first two, this kind of protocol has EIGRP.

II. The difference between RIP I and RIP II

RIPv1

Use broadcast to send routing updates

There is no subnet mask in the routing update information, so it is a classful routing protocol.

The RIP message size limit is 512 bytes and can carry up to 25 routing information.

RIPv2

Subnet mask is added to the routing information, classless routing protocol

RIPv2 sends update messages by multicast with a multicast address of 224.0.0.9

Support authentication

Characteristics

RIPv1

RIPv2

Use hop count as a measure

Yes

Yes

15 is the largest effective measure, 16 is infinity

Yes

Yes

Default 30s update cycle

Yes

Yes

Send all routing information during periodic updates

Yes

Yes

Send triggered updates only for changes when the topology changes

Yes

Yes

Use route poisoning, split horizontally, toxicity reversal

Yes

Yes

Use hold-down timer

Yes

Yes

The way updates are sent

Broadcast

Multicasting

Use UDP 520port to send messages

Yes

Yes

Subnet mask is included in the update and VLSM is supported.

No

Yes

Support authentication

No

Yes

1. Examples

In the following topology environment, all routers are configured as RIP v2 by default, and the whole network is interconnected through RIP protocol.

2. Analyze and troubleshoot (1), observe the information of routing protocols and routing tables after RIP routing is enabled (take R2 as an example)

R2#show ip protocols

Routing Protocol is "rip"

Sending updates every 30 seconds, next due in 9 seconds

Invalid after 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: rip

Default version control: send version 2, receive 2

Interface Send Recv Triggered RIP Key-chain

Loopback0 2 2

Serial1/1 2 2

Serial1/3 2 2

Serial1/0 2 2

Serial1/2 2 2

Automatic network summarization is not in effect

Maximum path: 4

Routing for Networks:

10.0.0.0

192.168.10.0

192.168.20.0

192.168.40.0

192.168.50.0

Passive Interface (s):

Routing Information Sources:

Gateway Distance Last Update

192.168.10.2 120 00:00:08

192.168.20.2 120 00:00:28

192.168.50.2 120 00:00:10

192.168.40.2 120 00:00:24

Distance: (default is 120)

Explanation: pay attention to the red part, as follows:

Sending updates every 30 seconds, next due in 9 seconds

Indicates that RIP sends an update to the routing table every time in 30 seconds, and the next update is after 9 seconds.

Invalid after 180 seconds, hold down 180, flushed after 240

Here is the timer information, the record will be treated as invalidation after 180 seconds, and will be paused and Down may be dropped after 180 seconds, and the information will be deleted from the routing table after 240 seconds.

Routing for Networks:

10.0.0.0

192.168.10.0

192.168.20.0

192.168.40.0

192.168.50.0

The network number of the route includes: (refer to the above, here is brief)

Distance: (default is 120)

The administrative distance defaults to 120

R2#show ip route rip

10.0.0.0/16 is subnetted, 5 subnets

R 10.2.0.0 [120/1] via 192.168.10.2, 00:00:06, Serial1/1

R 10.5.0.0 [120/1] via 192.168.20.2, 00:00:04, Serial1/0

R 10.11.0.0 [120/1] via 192.168.50.2, 00:00:02, Serial1/3

R 10.12.0.0 [120/1] via 192.168.40.2, 00:00:18, Serial1/2

192.168.30.0/30 is subnetted, 1 subnets

R 192.168.30.0 [120/1] via 192.168.40.2, 00:00:18, Serial1/2

[120/1] via 192.168.50.2, 00:00:02, Serial1/3

192.168.60.0/30 is subnetted, 1 subnets

R 192.168.60.0 [120/1] via 192.168.10.2, 00:00:06, Serial1/1

[120/1] via 192.168.20.2, 00:00:04, Serial1/0

Here we use show ip route rip instead of show ip route, because show ip route rip shows the routing table of the current router when the separate RIP protocol is enabled, while show ip route displays the entire routing table information of the current router. When we see which interface a network uses and how long it takes to learn, we can find that it takes no more than 30 seconds.

(2) set R5 not to let R1, R2, R3, R4 learn

First of all, we need to know how to learn the routing information of R5 without the other four routers. Here we can use the features of RIP v1 and RIP v2 to achieve this. The experiment is as follows:

Let's first set the RIP version of R5 to v1 and see what the difference will be between R5 and R2.

R5#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R5 (config) # route rip

R5 (config-router) # version 1

The following is used by R2 to view routing updates in real time, where the red part can see "ignore routing information from 192.168.40.2 v1 version (illegal version)", which indicates that the RIP of R5 has been changed to v1 and R2 is still v2, so it cannot receive its routing updates.

R2#debug ip rip

RIP: received v2 update from 192.168.20.2 on Serial1/0

10.2.0.0/16 via 0.0.0.0 in 2 hops

10.5.0.0/16 via 0.0.0.0 in 1 hops

192.168.60.0/30 via 0.0.0.0 in 1 hops

RIP: received v2 update from 192.168.50.2 on Serial1/3

10.11.0.0/16 via 0.0.0.0 in 1 hops

10.12.0.0/16 via 0.0.0.0 in 2 hops

192.168.30.0/30 via 0.0.0.0 in 1 hops

RIP: ignored v1 packet from 192.168.40.2 (illegal version)

RIP: received v2 update from 192.168.10.2 on Serial1/1

10.2.0.0/16 via 0.0.0.0 in 1 hops

10.5.0.0/16 via 0.0.0.0 in 2 hops

192.168.60.0/30 via 0.0.0.0 in 1 hops

If you look at the RIP routing table of R2, the red part has a time of 00:01:49 and has been over 30 seconds, but it has not reached 180 seconds, and its routing entry is updated exactly in 30 seconds.

R2#show ip route rip

10.0.0.0/16 is subnetted, 5 subnets

R 10.2.0.0 [120/1] via 192.168.10.2, 00:00:15, Serial1/1

R 10.5.0.0 [120/1] via 192.168.20.2, 00:00:05, Serial1/0

R 10.11.0.0 [120/1] via 192.168.50.2, 00:00:01, Serial1/3

R 10.12.0.0 [120/1] via 192.168.40.2, 00:01:49, Serial1/2

192.168.30.0/30 is subnetted, 1 subnets

R 192.168.30.0 [120/1] via 192.168.40.2, 00:01:49, Serial1/2

[120/1] via 192.168.50.2, 00:00:01, Serial1/3

192.168.60.0/30 is subnetted, 1 subnets

R 192.168.60.0 [120/1] via 192.168.10.2, 00:00:15, Serial1/1

[120/1] via 192.168.20.2, 00:00:05, Serial1/0

R2#

This is the RIP route record for R5, and all route records are more than 30 seconds, so the RIP route information cannot be updated.

R5#show ip route rip

10.0.0.0/16 is subnetted, 5 subnets

R 10.2.0.0 [120/2] via 192.168.40.1, 00:02:22, Serial0/0

R 10.5.0.0 [120/2] via 192.168.40.1, 00:02:22, Serial0/0

R 10.6.0.0 [120/1] via 192.168.40.1, 00:02:22, Serial0/0

R 10.11.0.0 [120/1] via 192.168.30.2, 00:02:14, Serial0/1

192.168.10.0/30 is subnetted, 1 subnets

R 192.168.10.0 [120/1] via 192.168.40.1, 00:02:22, Serial0/0

192.168.20.0/30 is subnetted, 1 subnets

R 192.168.20.0 [120/1] via 192.168.40.1, 00:02:22, Serial0/0

192.168.50.0/30 is subnetted, 1 subnets

R 192.168.50.0 [120/1] via 192.168.40.1, 00:02:22, Serial0/0

[120/1] via 192.168.30.2, 00:02:14, Serial0/1

192.168.60.0/30 is subnetted, 1 subnets

R 192.168.60.0 [120/2] via 192.168.40.1, 00:02:22, Serial0/0

R5#

Then look at the red part of the RIP routing table of R2. It is 00:03:00 and 180 seconds. At this time, the two routes are recorded as Possibly down (it is possible that down has been dropped)

R2#show ip route rip

10.0.0.0/16 is subnetted, 5 subnets

R 10.2.0.0 [120/1] via 192.168.10.2, 00:00:26, Serial1/1

R 10.5.0.0 [120/1] via 192.168.20.2, 00:00:18, Serial1/0

R 10.11.0.0 [120/1] via 192.168.50.2, 00:00:17, Serial1/3

R 10.12.0.0 is possibly down, routing via 192.168.40.2, 00:03:00, Serial1/2

192.168.30.0/30 is subnetted, 1 subnets

R 192.168.30.0 is possibly down, routing via 192.168.40.2, 00:03:00, Serial1/2

[120/1] via 192.168.50.2, 00:00:17, Serial1/3

192.168.60.0/30 is subnetted, 1 subnets

R 192.168.60.0 [120/1] via 192.168.10.2, 00:00:26, Serial1/1

[120/1] via 192.168.20.2, 00:00:18, Serial1/0

R2#

Finally, after more than 240seconds, these two records have been deleted from the RIP routing table, indicating that R2 and the other four routers can no longer learn the RIP routing updates for R5. At the same time, there is no other RIP routing information for R5, only the default directly connected routing information, which also means that even with Se0/1, R4 cannot update the routing information.

R2#show ip route rip

10.0.0.0/16 is subnetted, 4 subnets

R 10.2.0.0 [120/1] via 192.168.10.2, 00:00:17, Serial1/1

R 10.5.0.0 [120/1] via 192.168.20.2, 00:00:06, Serial1/0

R 10.11.0.0 [120/1] via 192.168.50.2, 00:00:12, Serial1/3

192.168.30.0/30 is subnetted, 1 subnets

R 192.168.30.0 [120/1] via 192.168.50.2, 00:00:12, Serial1/3

192.168.60.0/30 is subnetted, 1 subnets

R 192.168.60.0 [120/1] via 192.168.10.2, 00:00:17, Serial1/1

[120/1] via 192.168.20.2, 00:00:06, Serial1/0

R2#

The following is the routing table information after 240 seconds of R5.

R5#show 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, ia-IS-IS inter area

*-candidate default, U-per-user static route, o-ODR

P-periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/16 is subnetted, 1 subnets

C 10.12.0.0 is directly connected, Loopback0

192.168.30.0/30 is subnetted, 1 subnets

C 192.168.30.0 is directly connected, Serial0/1

192.168.40.0/30 is subnetted, 1 subnets

C 192.168.40.0 is directly connected, Serial0/0

3. Horizontal segmentation

First of all, split horizon is to reduce loops and speed up route aggregation. In practice, it is a technology that allows routers to send fewer routing tables and loops, thereby reducing router load. Let's analyze the lab (all routers are configured and the RIP v1 protocol is enabled by default):

Because split horizon is on by default, its principle is that information received from a port is no longer allowed to be sent out of that port. So in the following example, after R1 receives the routing update for R2 through the local port Se0/0/1, it will be broadcast from the Se0/0/0 port of R2. In addition, the local network is sent through the Se0/0/1 of R2 to reduce the loop. This is a complete process of horizontal segmentation.

R1#debug ip rip

RIP protocol debugging is on

R1#RIP: received v1 update from 192.168.10.2 on Serial0/0/1

192.168.20.0 in 1 hops

192.168.30.0 in 2 hops

RIP: sending v1 update to 255.255.255.255 via Serial0/0/0 (192.168.10.2)

RIP: build update entries

Network 192.168.20.0 metric 1

Network 192.168.30.0 metric 2

RIP: sending v1 update to 255.255.255.255 via Serial0/0/1 (192.168.20.2)

RIP: build update entries

Network 192.168.10.0 metric 1

After R1 cancels the split horizon, the entire routing table is sent directly from the local port, so repeated transmissions can cause loops, reduce the router load and put a lot of pressure on the link.

R1 (config) # interface serial0/0/1

R1 (config-if) # no ip split-horizon

R1 (config-if) # end

R1#

% SYS-5-CONFIG_I: Configured from console by console

RIP: sending v1 update to 255.255.255.255 via Serial0/0/1 (192.168.10.1)

RIP: build update entries

Network 192.168.10.0 metric 1

Network 192.168.20.0 metric 2

Network 192.168.30.0 metric 3

RIP: received v1 update from 192.168.10.2 on Serial0/0/1

192.168.20.0 in 1 hops

192.168.30.0 in 2 hops

4. Toxicity reversal

That is, we often say poisoned routing, which means that when a "metric 16" routing message is received, it is set to "possibly down", and another broadcast is sent out at the same time. If there are no more relevant routing updates, it will immediately clear the convergence of the accelerated route. (for example 2.4.3.3 horizontal split topology RIP v1 example, the analysis is as follows)

First of all, we shutdown the Se0/0/0 port of R3, and when we open the debug ip rip, a message will be sent to poison the route.

R3 (config) # int s0Action0Universe 0

R3 (config-if) # shutdown

R3 (config-if) #

% LINK-5-CHANGED: Interface Serial0/0/0, changed state to administratively down

% LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down

End

R3#

% SYS-5-CONFIG_I: Configured from console by console

R3#debug ip rip

RIP protocol debugging is on

R3#RIP: sending v1 update to 255.255.255.255 via Serial0/0/1 (192.168.30.1)

RIP: build update entries

Network 192.168.10.0 metric 16

Let's take a look at the RIP broadcast on R2 and the routing table information on R1.

R2#debug ip rip

RIP protocol debugging is on

R2#RIP: sending v1 update to 255.255.255.255 via Serial0/0/0 (192.168.10.2)

RIP: build update entries

Network 192.168.30.0 metric 16

-

R1#show ip route

Codes: l-local, C-connected, S-static, 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, ia-IS-IS inter area

*-candidate default, U-per-user static route, o-ODR

P-periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C 10.2.0.0/16 is directly connected, Loopback0

L 10.2.0.2/32 is directly connected, Loopback0

192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.10.0/30 is directly connected, Serial0/0/1

L 192.168.10.1/32 is directly connected, Serial0/0/1

R 192.168.20.0/24 is possibly down, routing via 192.168.10.2, Serial0/0/1

R 192.168.30.0/24 is possibly down, routing via 192.168.10.2, Serial0/0/1

R2 has forwarded the poisoned route to R1, and R1 will also set the broadcast to "Passibly down" and eliminate it the next time there is no update. This is the process of poisoning reversal and the behavior of the router.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report