自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

RIP配置的完美攻略

網(wǎng)絡(luò) 網(wǎng)絡(luò)管理
下面我們主要講解一下RIP配置的具體過程。包括了IP地址配置、RIP配置命令、測試RIP配置正確性等有關(guān)內(nèi)容。

對于RIP協(xié)議,大家可能是比較熟悉了。這個(gè)協(xié)議的使用是非常廣泛的。在很多組網(wǎng)中,都會應(yīng)用這個(gè)協(xié)議。如果你還不會RIP配置的話,也不用著急,接下來我們就來細(xì)致地講解一下配置過程,保準(zhǔn)大家都能學(xué)會。

IP地址配置

我們可以使用interface命令進(jìn)入局部配置模式,然后利用ip address設(shè)置接口的IP地址.如下所示.

  1. testBJ#conf t  
  2. Enter configuration commands, one per line. End with CNTL/Z.  
  3. testBJ(config)#interface e0/1  
  4. testBJ(config-if)#ip address 172.16.1.2 255.255.255.0  
  5. testBJ(config-if)# 

為了便于配置和記憶,你還可以給每個(gè)端口添加一些描述信息.如下所示,在端口局部配置模式下使用description命令.

  1. testBJ(config-if)#description connect to testSH  
  2. testBJ(config-if)#end  
  3. testBJ# 

有些網(wǎng)絡(luò)是NBMA(Non-Broadcast MultiAccess,非廣播多路訪問)的,即網(wǎng)絡(luò)上不允許廣播傳送數(shù)據(jù).對于這種網(wǎng)絡(luò),RIP就不能依賴廣播傳遞路由表了.解決方法有很多,最簡單的是指定鄰居(neighbor),即指定將路由表發(fā)送給某一臺特定的路由器.

RIP配置

RIP配置是最容易的.配置它只需要兩步操作,首先,指定使用RIP協(xié)議,然后,聲明所連接的網(wǎng)絡(luò)號,如下所示.

  1. testBJ(config)#router rip  
  2. testBJ(config-router)#network 172.16.0.0  
  3. testBJ(config-router)#end  
  4. testBJ# 

router rip命令用于指定使用RIP協(xié)議,network命令聲明網(wǎng)絡(luò)號,由于RIP是一個(gè)有類路由協(xié)議,所以不必聲明各個(gè)子網(wǎng)號.對每一臺路由器重復(fù)上述操作,一個(gè)使用RIP路由的網(wǎng)絡(luò)就建成了.

測試RIP配置正確性

RIP配置之后,要檢查數(shù)據(jù)是否可以被正確路由.除了可以使用上面提到的連通性測試工具之外,還有以下幾個(gè)命令:

sh ip route用于檢測路由表;

sh ip protocols用于檢查路由協(xié)議狀況;

debug ip rip用于調(diào)試RIP協(xié)議信息.

使用sh ip route命令顯示各臺路由器的路由表.

  1. testBJ#sh ip route  
  2. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP  
  3. D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  4. N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  5. E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP  
  6. i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,  
  7. * - candidate default, U - per-user static route, o - ODR  
  8. Gateway of last resort is not set  
  9. 172.16.0.0/24 is subnetted, 4 subnets  
  10. R 172.16.4.0 [120/1] via 172.16.2.2, 00:00:12, Serial1/0  
  11. C 172.16.1.0 is directly connected, Ethernet0/1  
  12. C 172.16.2.0 is directly connected, Serial1/0  
  13. R 172.16.3.0 [120/1] via 172.16.1.3, 00:00:09, Ethernet0/1  
  14. [120/1] via 172.16.2.2, 00:00:22, Serial1/0 

上面顯示的是北京路由器的路由信息.字母C開頭的是直接相連的網(wǎng)絡(luò),有172.16.1.0和172.16.2.0,分別連接在e0/1和s1/0端口上.字母R開頭的是RIP協(xié)議學(xué)習(xí)到的路由,有172.16.3.0和172.16.4.0,其中,到172.16.3.0有兩條路徑供選擇,分別經(jīng)由testSH和testTJ路由器.對比網(wǎng)絡(luò)拓?fù)鋱D,可以看出實(shí)際情況與設(shè)計(jì)的完全一致.中括號里的內(nèi)容是路由項(xiàng)的管理距離和度量值,RIP配置的缺省管理距離是120,到達(dá)3、4子網(wǎng)的度量值是1,即經(jīng)過1個(gè)路由器可達(dá).同樣的命令在另外兩臺路由器上運(yùn)行,結(jié)果如下.

  1. testSH#sh ip route  
  2. Gateway of last resort is not set  
  3. 172.16.0.0/24 is subnetted, 4 subnets  
  4. R 172.16.4.0 [120/1] via 172.16.3.2, 00:00:13, Ethernet0/0  
  5. C 172.16.1.0 is directly connected, Ethernet0/1  
  6. R 172.16.2.0 [120/1] via 172.16.1.2, 00:00:11, Ethernet0/1  
  7. [120/1] via 172.16.3.2, 00:00:13, Ethernet0/0  
  8. C 172.16.3.0 is directly connected, Ethernet0/0  
  9. testTJ#sh ip route  
  10. Gateway of last resort is not set  
  11. 172.16.0.0/24 is subnetted, 4 subnets  
  12. C 172.16.4.0 is directly connected, Ethernet0/0  
  13. R 172.16.1.0 [120/1] via 172.16.3.3, 00:00:07, Ethernet0/1  
  14. [120/1] via 172.16.2.3, 00:00:19, Serial1/0  
  15. C 172.16.2.0 is directly connected, Serial1/0  
  16. C 172.16.3.0 is directly connected, Ethernet0/1 

分析上述命令輸出時(shí),一定要隨時(shí)參照拓?fù)鋱D,離開網(wǎng)絡(luò)拓?fù)?上面的信息就沒有任何意義.動態(tài)路由的靈活性體現(xiàn)在一條鏈路出現(xiàn)故障,路由算法會自動切換到迂回鏈路上.例如我們將testBJ和testTJ之間的串行線纜斷開,一段時(shí)間后,再檢查路由表,如下所示.

  1. testBJ#sh ip route  
  2. Gateway of last resort is not set  
  3. 172.16.0.0/24 is subnetted, 3 subnets  
  4. R 172.16.4.0 [120/2] via 172.16.1.3, 00:00:22, Ethernet0/1  
  5. C 172.16.1.0 is directly connected, Ethernet0/1  
  6. R 172.16.3.0 [120/1] via 172.16.1.3, 00:00:22, Ethernet0/1 

我們發(fā)現(xiàn)串行鏈路所在的子網(wǎng)2斷開了,到網(wǎng)絡(luò)172.16.4.0網(wǎng)絡(luò)的數(shù)據(jù)包都將繞經(jīng)testSH路由器.

sh ip protocols命令可以顯示當(dāng)前路由協(xié)議的狀況,如下所示.

  1. testBJ#sh ip protocols  
  2. Routing Protocol is "rip"  
  3. Sending updates every 30 seconds, next due in 19 seconds  
  4. Invalid after 180 seconds, hold down 180, flushed after 240  
  5. Outgoing update filter list for all interfaces is not set  
  6. Incoming update filter list for all interfaces is not set  
  7. Redistributing: connected, rip  
  8. Default version control: send version 1, receive any version  
  9. Interface Send Recv Key-chain  
  10. Ethernet0/1 1 1 2  
  11. Serial1/0 1 1 2  
  12. Routing for Networks:  
  13. 172.16.0.0  
  14. Routing Information Sources:  
  15. Gateway Distance Last Update  
  16. 172.16.2.2 120 00:00:05  
  17. 172.16.1.3 120 00:00:27  
  18. Distance: (default is 120) 

從命令輸出中,可以看出RIP配置,還可以得知與當(dāng)前路由器交換信息的路由器有testTJ(172.16.2.2)和testSH(172.16.1.3)兩臺路由器,上次接收路由信息分別在5秒和27秒之前.要了解路由器之間交換路由信息的詳情,可以使用debug ip rip命令.如下所示,輸入命令后,隔一段時(shí)間,控制臺上出現(xiàn)接收或者發(fā)送RIP廣播的信息.

  1. testBJ#debug ip rip  
  2. RIP protocol debugging is on  
  3. testBJ#  
  4. RIP: received v1 update from 172.16.2.2 on Serial1/0  
  5. 172.16.4.0 in 1 hops  
  6. 172.16.3.0 in 1 hops  
  7. RIP: received v1 update from 172.16.1.3 on Ethernet0/1  
  8. 172.16.4.0 in 2 hops  
  9. 172.16.3.0 in 1 hops  
  10. RIP: sending v1 update to 255.255.255.255 via Ethernet0/1 (172.16.1.2)  
  11. subnet 172.16.4.0, metric 2  
  12. subnet 172.16.2.0, metric  
  13. RIP: sending v1 update to 255.255.255.255 via Serial1/0 (172.16.2.3)  
  14. subnet 172.16.1.0, metric 1  
  15. RIP: received v1 update from 172.16.1.3 on Ethernet0/1  
  16. 172.16.4.0 in 2 hops  
  17. 172.16.3.0 in 1 hops  
  18. RIP: received v1 update from 172.16.2.2 on Serial1/0  
  19. 172.16.4.0 in 1 hops  
  20. 172.16.3.0 in 1 hops  
  21. testBJ#no debug all  
  22. All possible debugging has been turned off  
  23. testBJ# 

從上述RIP配置信息中可以得到RIP廣播的詳情.路由器先是從testTJ收到子網(wǎng)3、4的信息,然后又從testSH收到子網(wǎng)3、4的信息.其中,到子網(wǎng)4走testTJ一跳,走testSH兩跳,所以,路由表中反映出來的是經(jīng)由testTJ到子網(wǎng)4;到子網(wǎng)3的距離都是一跳,所以,路由表中有兩條并列的路由.一段時(shí)間后,當(dāng)前路由器的更新計(jì)時(shí)達(dá)到30秒,于是,它在兩條鏈路上廣播自身的路由表信息.注意,廣播路由更新時(shí),RIP采用了水平分割機(jī)制,從一個(gè)端口上學(xué)得的信息就不在這個(gè)端口上進(jìn)行廣播,所以當(dāng)前路由器testBJ只發(fā)送子網(wǎng)172.16.1.0的路由信息.使用no debug all命令結(jié)束調(diào)試信息的顯示.需要注意的是debug命令非常消耗路由器資源,所以不要在通訊繁忙的路由器上使用,否則,路由器就會象死機(jī)一樣停止反應(yīng).

責(zé)任編輯:佟健 來源: QQread
相關(guān)推薦

2010-08-30 16:46:08

Linux DHCP配

2010-08-30 10:53:10

職場

2010-07-02 14:23:33

Ftp服務(wù)默認(rèn)端口

2010-03-30 14:58:57

手機(jī)無線上網(wǎng)設(shè)置

2010-08-06 10:55:50

配置RIP路由協(xié)議

2010-07-28 22:20:10

RIP路由配置

2010-05-31 10:32:38

面試簡歷

2010-08-06 09:24:07

RIP路由協(xié)議

2015-03-11 09:24:54

RIP動態(tài)路由協(xié)議loopback

2011-01-21 09:32:57

LinuxSendmail

2010-06-30 14:12:48

2013-08-12 09:47:41

RIP協(xié)議網(wǎng)絡(luò)協(xié)議

2009-03-31 09:22:15

2009-10-10 15:54:55

RHEL 4配置Pos

2010-08-06 13:53:12

RIP協(xié)議

2009-11-06 14:51:14

WCF配置子節(jié)點(diǎn)

2010-03-30 13:09:12

2010-05-19 13:44:42

Subversion+

2010-07-30 14:31:20

RIP協(xié)議

2011-04-01 09:04:09

RIP
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號