日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

动态路由协议(RIP)

發布時間:2023/12/9 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 动态路由协议(RIP) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
動態路由協議包括距離矢量路由協議和鏈路狀態路由協議。RIPRouting InformationProtocols,路由信息協議)是使用最廣泛的距離矢量路由協議。RIP 是為小型網絡環境設計的,因為這類協議的路由學習及路由更新將產生較大的流量,占用過多的帶寬。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

??? ?RIP 協議分為版本1 和版本2。不論是版本1或版本2,都具備下面的特征:

1. 是距離向量路由協議;

2. 使用跳數(Hop Count)作為度量值;

3.默認路由更新周期為30 秒;

4. 管理距離(AD)為120

5. 支持觸發更新;

6. 最大跳數為15 跳;

7. 支持等價路徑,默認4 ,最大6 條;

8. 使用UDP520 端口進行路由更新。

通過下面的實驗來學習RIPv1RIPv2的配置:

在路由器上啟動RIPv1進程

(1)??? 步驟1:配置路由器R1

R1(config)#router rip?????????????????? //啟動RIP進程

R1(config-router)#version 1???????????? //配置RIP版本1

R1(config-router)#network <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.0.0.0?????? //宣告直連網段

R1(config-router)#network 192.168.1.0

2)步驟2:配置路由器R2

R2(config)#router rip

R2(config-router)#version 1

R2(config-router)#network 192.168.1.0

R2(config-router)#network 192.168.2.0

3)步驟3:配置路由器R3

R3(config)#router rip

R3(config-router)#version 1

R3(config-router)#network 192.168.2.0

R3(config-router)#network 192.168.3.0

4)步驟4:配置路由器R4

R4(config)#router rip

R4(config-router)#version 1

R4(config-router)#network 192.168.3.0

R4(config-router)#network 4.0.0.0

調試:(1)使用show ip route 命令查看路由表

R1#show ip route

Codes: 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

?????? i - IS-IS, su - IS-IS summary, 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

?

???? 1.0.0.0/24 is subnetted, 1 subnets

C?????? 1.1.1.0 is directly connected, Loopback0

R??? 4.0.0.0/8 [120/3] via 192.168.1.2, 00:00:14, Ethernet0/0

C??? 192.168.1.0/24 is directly connected, Ethernet0/0

R??? 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:14, Ethernet0/0

R??? 192.168.3.0/24 [120/2] via 192.168.1.2, 00:00:14, Ethernet0/0

以上輸出表明路由器R1 學到了3 RIP 路由,其中路由條目“R 4.0.0.0/8 [120/3]via 192.168.1.2, 00:00:14, Ethernet0/0”的含義如下:

R:路由條目是通過RIP 路由協議學習來的;

4.0.0.0/8:目的網絡;

120RIP 路由協議的默認管理距離;

3: 度量值,從路由器R1 到達網絡4.0.0.0/8 的度量值為3 跳;

192.168.1.2:下一跳地址;

00:00:14:距離下一次更新還有1630-14)秒;

Ethernet0/0:接收該路由條目的本路由器的接口。

同時通過該路由條目的掩碼長度可以看到,RIPv1 確實不傳遞子網信

2show ip protocol該命令查看IP 路由協議配置和統計信息。

R1#show ip protocol

Routing Protocol is "rip"

? Outgoing update filter list for all interfaces is not set

? Incoming update filter list for all interfaces is not set

? Sending updates every 30 seconds, next due in 22 seconds

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

? Redistributing: rip

? Default version control: send version 1, receive version 1

??? Interface???????????? Send? Recv? Triggered RIP? Key-chain

??? Ethernet0/0?????????? 1???? 1

??? Loopback0???????????? 1???? 1

? Automatic network summarization is in effect

??Maximum path: 4

? Routing for Networks:

??? 1.0.0.0

??? 192.168.1.0

? Routing Information Sources:

??? Gateway???????? Distance????? Last Update

??? 192.168.1.2????????? 120????? 00:00:08

? Distance: (default is 120)

其中:Routing Protocol is "rip"

//路由器上運行的路由協議是RIP

Outgoing update filter list for all interfaces is not set

//在出方向上沒有設置過濾列表

Incoming update filter list for all interfaces is not set

//在入方向上沒有設置過濾列表

Sending updates every 30 seconds, next due in 22 seconds

//更新周期是30 秒,距離下次更新還有22

Redistributing: rip

//只運行RIP 協議,沒有其它的協議重分布進來

Default version control: send version 1, receive version 1

//默認發送版本1 的路由更新,接收本版1 的路由更新

Interface???????????? Send? Recv? Triggered RIP? Key-chain

??? Ethernet0/0?????????? 1???? 1

??? Loopback0???????????? 1???? 1

Automatic network summarization is in effect

//RIP 路由協議默認開啟自動匯總功能

Maximum path: 4

//RIP 路由協議可以支持4 條等價路徑,最大為6

【提示】

可以通過下面的命令來修改RIP 路由協議支持等價路徑的條數:

R1(config-router)#maximum-paths number-paths

? 3debug ip rip:查看RIP 路由協議的動態更新過程。

R1#debug ip rip

RIP protocol debugging is on

R1#

*Mar? 1 00:46:53.487: RIP: received v1 update from 192.168.1.2 on Ethernet0/0

*Mar? 1 00:46:53.487:????? 4.0.0.0 in 3 hops

*Mar? 1 00:46:53.491:????? 192.168.2.0 in 1 hops

*Mar? 1 00:46:53.491:????? 192.168.3.0 in 2 hops

*Mar? 1 00:46:58.747: RIP: sending v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)

*Mar? 1 00:46:58.747: RIP: build update entries

*Mar? 1 00:46:58.747:?? network 4.0.0.0 metric 4

*Mar? 1 00:46:58.751:?? network 192.168.1.0 metric 1

*Mar? 1 00:46:58.751:?? network 192.168.2.0 metric 2

*Mar? 1 00:46:58.751:?? network 192.168.3.0 metric 3

*Mar? 1 00:46:59.347: RIP: sending v1 update to 255.255.255.255 via Ethernet0/0(192.168.1.1)

*Mar? 1 00:46:59.347: RIP: build update entries

*Mar? 1 00:46:59.347:?? network 1.0.0.0 metric 1

通過以上輸出,可以看到RIPv1 采用廣播更新(255.255.255.255

在路由器上啟動RIPv2進程

?

1)步驟1:配置路由器R1

R1(config)#router rip??????? //啟動RIP進程

R1(config-router)#version 2?? //配置RIP版本2

R1(config-router)#no auto-summary?? //關閉自動匯總

R1(config-router)#network 1.0.0.0

R1(config-router)#network 192.168.1.0

2)步驟2:配置路由器R2

R2(config)#router rip

R2(config-router)#version 2

R2(config-router)#no auto-summary

R2(config-router)#network 192.168.1.0

R2(config-router)#network 192.168.2.0

3)步驟3:配置路由器R3

R3(config)#router rip

R3(config-router)#version 2

R3(config-router)#no auto-summary

R3(config-router)#network 192.168.2.0

R3(config-router)#network 192.168.3.0

4)步驟4:配置路由器R4

R4(config)#router rip

R4(config-router)#version 2

R4(config-router)#no auto-summary

R4(config-router)#network 192.168.3.0

R4(config-router)#network 4.0.0.0

調試:(1)使用show ip route 命令查看路由表

R1#show ip route

Codes: 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

?????? i - IS-IS, su - IS-IS summary, 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

?

???? 1.0.0.0/24 is subnetted, 1 subnets

C?????? 1.1.1.0 is directly connected, Loopback0

?? ?4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

R? ?4.4.4.0/24 [120/3] via 192.168.1.2, 00:00:22, Ethernet0/0

C??? 192.168.1.0/24 is directly connected, Ethernet0/0

R??? 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:11, Ethernet0/0

R??? 192.168.3.0/24 [120/2] via 192.168.1.2, 00:00:11, Ethernet0/0

從上面輸出的路由條目“4.4.4.0/24”,可以看到RIPv2 路由更新是攜帶子網信息

2show ip protocol該命令查看IP 路由協議配置和統計信息。

?

R1#show ip protocol

Routing Protocol is "rip"

? Outgoing update filter list for all interfaces is not set

? Incoming update filter list for all interfaces is not set

? Sending updates every 30 seconds, next due in 2 seconds

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

? Redistributing: rip

? Default version control: send version 2, receive version 2

??? Interface???????????? Send? Recv? Triggered RIP? Key-chain

??? Ethernet0/0?????????? 2???? 2

??? Loopback0???????????? 2???? 2

? Automatic network summarization is not in effect

? Maximum path: 4

? Routing for Networks:

??? 1.0.0.0

??? 192.168.1.0

? Routing Information Sources:

??? Gateway???????? Distance????? Last Update

??? 192.168.1.2????????? 120????? 00:00:23

? Distance: (default is 120)

// RIPv2 默認情況下只接收和發送版本2 的路由更新

【提示】

可以通過命令“ip rip send version”和“ip rip receive version”來控制在路由器接口上接收和發送的版本,例如在Ethernet0/0 接口上接收版本1 2 的路由更新,但是只發送版本2 的路由更新,配置如下:

R1(config-if)#ip rip send version 2

R1(config-if)#ip rip receive version 1 2

3)通過debug ip rip 命令查看RIP 路由協議的動態更新過程。

R1#debug ip rip

RIP protocol debugging is on

*Mar? 1 01:37:27.119: RIP: received v2 update from 192.168.1.2 on Ethernet0/0

*Mar? 1 01:37:27.119:????? 4.4.4.0/24 via 0.0.0.0 in 3 hops

*Mar? 1 01:37:27.123:????? 192.168.2.0/24 via 0.0.0.0 in 1 hops

*Mar? 1 01:37:27.123:????? 192.168.3.0/24 via 0.0.0.0 in 2 hops

*Mar? 1 01:37:29.627: RIP: sending v2 update to 224.0.0.9 via Ethernet0/0 (192.1

68.1.1)

*Mar? 1 01:37:29.627: RIP: build update entries

*Mar? 1 01:37:29.627:?? 1.1.1.0/24 via 0.0.0.0, metric 1, tag

通過以上輸出,可以看到RIPv2 采用組播更新(224.0.0.9) ?

轉載于:https://blog.51cto.com/shani/369631

總結

以上是生活随笔為你收集整理的动态路由协议(RIP)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。