1 小組成員
2 實驗目的
實現一個有回路的拓撲,驗證RIP協議能夠有效阻止路由回路。
3 實驗步驟
3.1 實驗設備
PC:兩台;
Router:三台;
交叉線;
直連線;
3.2 實驗拓撲
3.3 IP地址規划
設備名稱 | 端口 | 地址 |
---|---|---|
PC0 | FastEthernet | 192.168.10.2 |
PC1 | FastEthernet | 192.168.40.2 |
路由器1 | FastEthernet0/0 Serial2/0 |
192.168.10.1 192.168.20.1 |
路由器2 | Serial2/0 Serial3/0 |
192.168.20.2 192.168.30.1 |
路由器3 | Serial3/0 FastEthernet0/0 |
192.168.30.2 172.168.40.1 |
3.4 拓撲准備
-
如圖連接拓撲
-
分別為PC0、PC1配置IP地址
-
打開路由器1的FastEthernet0/0端口,設置IP地址為192.168.10.1;並將Serial2/0端口打開,設置Clock Rate 64000, IP Address:192.168.20.1;
打開路由器2的Serial2/0、3/0端口,設置Clock Rate 64000, IP Address分別為192.168.20.2、192.168.30.1;
打開路由器3FastEthernet0/0端口,設置IP地址為192.168.40.1;並將Serial3/0端口打開,設置Clock Rate 64000, IP Address:192.168.30.2
以R1為例: R1(config)#interface FastEthernet0/0 R1(config-if)#ip address 192.168.10.1 255.255.255.0 R1(config-if)#interface Serial 2/0 R1(config-if)#ip address 192.168.20.1 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown
-
為PC配置默認網關,以PC0為例
-
R1、R2、R3打開rip,以R3為例
Router(config)#router rip Router(config-router)#network 192.168.40.0 Router(config-router)#network 192.168.30.0
-
在R3中開啟debug模式,並查看路由表
Router#debug ip rip
Router#show ip route
發現此時路由器配置無誤
-
PC0 ping PC1,說明拓撲無誤
3.5 構造路由回路
-
為了構造路由回路,我們需要先關閉R2和R3之間的水平分割
R3(config)#in s3/0 R3(config-if)#no ip split-horizon R2(config)#in s3/0 R2(config-if)#no ip split-horizon
-
將PC1和R3間的鏈路斷開
-
在debug模式下觀察R2、R3的rip及路由表
R2
R3
可以看出
路由器 目的網段 下一條路由器 R2 192.168.40.0 R3 R3 192.168.40.0 R2 這就形成了路由回路
-
進入模擬模式,PC0上ping 192.168.40.2(ping 192.168.40.1結果也一樣)
可以看到ICMP包在R2、R3間不斷傳遞,進入死循環,這就造成了路由回路,故超時
3.6 RIP協議避免路由回路
-
恢復鏈路,並開啟R2、R3間的水平分割
R2(config)#in s3/0 R2(config-if)#ip split-horizon R3(config)#in s3/0 R3(config-if)#ip split-horizon
-
斷開PC1與R3間的鏈路
-
在debug模式下觀察R2、R3的rip及路由表
R3
R2
可以看到,開啟水平分割后R3不會從R2收到關於192.168.40.0的信息,R2也不會向R3發送192.168.40.0的信息
-
180s后,查看R2的路由表
192.168.40.0已經為down狀態
-
在PC0上ping 192.168.40.2(ping 192.168.40.1結果也一樣)