Redistribute
成都創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),新?lián)崞髽I(yè)網(wǎng)站建設(shè),新?lián)崞放凭W(wǎng)站建設(shè),網(wǎng)站定制,新?lián)峋W(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,新?lián)峋W(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。Dynamips模擬器
Cisco IOS Software, 3700 Software (C3745-ADVIPSERVICESK9-M), Version 12.4(4)T, RELEASE SOFTWARE (fc1)
拓撲結(jié)構(gòu)
如下圖所示,R1與R2之間使用靜態(tài)路由(默認路由),R1與R3之間使用RIP,R1與R4之間使用EIGRP,R1與R5之間使用OSPF。
操作過程如下
一、基本配置
按網(wǎng)絡(luò)拓撲圖設(shè)置端口IP,確保相鄰端口之間能夠相互ping通。
配置略。
二、路由配置
為方便測試,在配置動態(tài)路由時,使用no auto-summary命令關(guān)閉自動匯總(OSPF默認是不匯總的,也沒有no auto-summary命令)。
R1,各端口分別按要求配置不同的路由
R1(config)#ip route 2.2.2.0 255.255.255.0 192.168.2.2
R1(config)#router rip
R1(config-router)#net 192.168.3.0
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#exit
R1(config)#router eigrp 100
R1(config-router)#net 192.168.4.0
R1(config-router)#no auto-summary
R1(config-router)#exit
R1(config)#router ospf 1
R1(config-router)#net 192.168.5.0 0.0.0.255 area 0
R1(config-router)#exit
------------------------------------
R2,配置默認路由
R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.1
------------------------------------
R3,配置RIP
R3(config)#router rip
R3(config-router)#net 192.168.3.0
R3(config-router)#net 3.3.3.0
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#exit
------------------------------------
R4,配置EIGRP
R4(config)#router eigrp 100
R4(config-router)#net 192.168.4.0
*Mar 1 00:17:48.019: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 192.168.4.1 (FastEthernet1/4) is up: new adjacency
R4(config-router)#net 4.4.4.0
R4(config-router)#no auto-summary
*Mar 1 01:08:34.239: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 192.168.4.1 (FastEthernet1/4) is resync: summary configured
R4(config-router)#exit
------------------------------------
R5,配置OSPF
R5(config)#router ospf 1
R5(config-router)#net 192.168.5.0 0.0.0.255 area 0
*Mar 1 00:19:05.547: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.5.1 on FastEthernet1/5 from LOADING to FULL, Loading Done
R5(config-router)#net 5.5.5.0 0.0.0.255 area 0
R5(config-router)#exit
------------------------------------
配置好路由后,因為R1處于網(wǎng)絡(luò)邊界,且同時運行了不同的路由協(xié)議,所在R1可以學(xué)習(xí)到整個網(wǎng)絡(luò)的完整路由。show ip route命令查看R1路由,如下:
R1#sh 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
2.0.0.0/24 is subnetted, 1 subnets
S 2.2.2.0 [1/0] via 192.168.2.2
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/1] via 192.168.3.3, 00:00:28, FastEthernet1/3
4.0.0.0/24 is subnetted, 1 subnets
D 4.4.4.0 [90/156160] via 192.168.4.4, 00:02:16, FastEthernet1/4
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/2] via 192.168.5.5, 01:09:20, FastEthernet1/5
C 192.168.4.0/24 is directly connected, FastEthernet1/4
C 192.168.5.0/24 is directly connected, FastEthernet1/5
C 192.168.2.0/24 is directly connected, FastEthernet1/2
C 192.168.3.0/24 is directly connected, FastEthernet1/3
------------------------------------
R2、R3、R4、R5之間,由于路由協(xié)議的不相同,當(dāng)前情況下是相互看不到的。需要在R1上進行重分發(fā)。
三、配置重分發(fā)
重分發(fā)的配置是在邊界路由器,即R1上設(shè)置的。
1、靜態(tài)路由與RIP的重分發(fā)
R1(config)#router rip
R1(config-router)#redistribute connected !把直連路由分布到路由協(xié)議中
R1(config-router)#redistribute static !將靜態(tài)路由重分發(fā)到RIP中
------------------------------------
配置結(jié)束后,在R2仍然只能看默認路由,但R3上已經(jīng)可以看到到達R2的路由了,并且R2 ping 3.3.3.3,R3 ping 2.2.2.2都是通的。
另外,配置結(jié)束后,在R3上也可以看到到達192.168.4.0、192.168.5.0網(wǎng)段的路由,但此時的R3并不能ping通R4、R5,是因為R1沒有對ospf、eigrp進行重分發(fā)。
查看此時R2和R3的路由表及ping測試:
R2#sh ip route
……
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
C 192.168.2.0/24 is directly connected, FastEthernet1/2
S* 0.0.0.0/0 [1/0] via 192.168.2.1
------------------------------------
R2#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/34/64 ms
------------------------------------
R3#sh ip route
……
R 2.0.0.0/8 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
R 192.168.4.0/24 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
R 192.168.5.0/24 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
C 192.168.3.0/24 is directly connected, FastEthernet1/3
------------------------------------
R3#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/39/64 ms
------------------------------------
2、靜態(tài)路由與EIGRP的重分發(fā)
R1(config)#router eigrp 100
R1(config-router)#redistribute connected
R1(config-router)#redistribute static !將靜態(tài)路由重分發(fā)到eigrp中
------------------------------------
配置結(jié)束后,在R2上仍然只能看默認路由,但R4上已經(jīng)可以看見到達R2的路由了,并且R2 ping 4.4.4.4,R4 ping 2.2.2.2都是通的。
查看此時R4的路由表:
R4#sh ip route
……
2.0.0.0/24 is subnetted, 1 subnets
D EX 2.2.2.0 [170/30720] via 192.168.4.1, 01:14:10, FastEthernet1/4
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
C 192.168.4.0/24 is directly connected, FastEthernet1/4
D EX 192.168.5.0/24 [170/30720] via 192.168.4.1, 01:14:10, FastEthernet1/4
D EX 192.168.2.0/24 [170/30720] via 192.168.4.1, 01:14:10, FastEthernet1/4
D EX 192.168.3.0/24 [170/30720] via 192.168.4.1, 01:14:10, FastEthernet1/4
------------------------------------
3、靜態(tài)路由與OSPF的重分發(fā)
R1(config)#router ospf 1
R1(config-router)#redistribute connected
% Only classful networks will be redistributed
R1(config-router)#redistribute static subnets !將靜態(tài)路由重分發(fā)到ospf中
% Only classful networks will be redistributed
------------------------------------
注意,把路由重分發(fā)到OSPF中,后面要寫subnets選項,否則除主類以外的子網(wǎng)不能被重新分發(fā)進路由表。以上命令中,如果不加subnets字段,R2可ping 通5.5.5.5,但R5 ping 不通2.2.2.2(R5可以ping通R2)。
配置結(jié)束后,在R2上仍然只能看靜態(tài)路由(默認路由),但R5上已經(jīng)可以看見到達R2的路由了,并且R2 ping 5.5.5.5,R5 ping 2.2.2.2都是通的。
查看此時R5的路由表:
R5#sh ip route
……
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback0
O E2 192.168.4.0/24 [110/20] via 192.168.5.1, 01:14:13, FastEthernet1/5
C 192.168.5.0/24 is directly connected, FastEthernet1/5
O E2 192.168.2.0/24 [110/20] via 192.168.5.1, 01:14:13, FastEthernet1/5
O E2 192.168.3.0/24 [110/20] via 192.168.5.1, 01:14:13, FastEthernet1/5
------------------------------------
4、RIP與EIGRP重分發(fā)
R1(config)#router rip
R1(config-router)#redistribute eigrp 100 metric 10 !將eigrp重分發(fā)到rip
R1(config-router)#exit
R1(config)#router eigrp 100
R1(config-router)#redistribute rip metric 10000 100 255 1 1500 !將rip重分發(fā)到eigrp
------------------------------------
注意,將eigrp重分發(fā)到rip時,必須指明度量,即命令redistribute eigrp 100 metric 10,如果沒有“metric 10”,則R3看不到R4的路由。
重分發(fā)路由協(xié)議到eigrp時,也必須指度量,并且要指明帶寬等,命令“metric 10000 100 255 1 1500”中的五個參數(shù)一定要正確,否則會報錯“% Incomplete command”。這五個參數(shù)中,唯一可以修改的是帶寬值,可根據(jù)實際情況設(shè)置,其他4個參數(shù)不能改。五個參數(shù)如下:
Bandwidth in kilobytes=10000
Delay in 10s of microseconds=100
Reliability=255(maximum)
Loading=1(minimum)
Maximum Transmission Unit=1500
配置完成后,在R3、R4上可以看到彼此之間的路由了。
查看此時R3及R4的路由表:
R3#sh ip route
……
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/1] via 192.168.3.1, 00:00:23, FastEthernet1/3
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/10] via 192.168.3.1, 00:00:23, FastEthernet1/3
R 192.168.4.0/24 [120/1] via 192.168.3.1, 00:00:23, FastEthernet1/3
R 192.168.5.0/24 [120/1] via 192.168.3.1, 00:00:23, FastEthernet1/3
R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:23, FastEthernet1/3
C 192.168.3.0/24 is directly connected, FastEthernet1/3
------------------------------------
R4#sh ip route
……
2.0.0.0/24 is subnetted, 1 subnets
D EX 2.2.2.0 [170/30720] via 192.168.4.1, 01:32:39, FastEthernet1/4
3.0.0.0/24 is subnetted, 1 subnets
D EX 3.3.3.0 [170/284160] via 192.168.4.1, 00:02:12, FastEthernet1/4
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
C 192.168.4.0/24 is directly connected, FastEthernet1/4
D EX 192.168.5.0/24 [170/30720] via 192.168.4.1, 01:32:39, FastEthernet1/4
D EX 192.168.2.0/24 [170/30720] via 192.168.4.1, 01:32:39, FastEthernet1/4
D EX 192.168.3.0/24 [170/30720] via 192.168.4.1, 01:32:39, FastEthernet1/4
------------------------------------
5、RIP與OSPF重分發(fā)
R1(config)#router rip
R1(config-router)#redistribute ospf 1 metric 10
R1(config-router)#exit
R1(config)#router ospf 1
R1(config-router)#redistribute rip metric 200 subnets
------------------------------------
注意,將ospf重分發(fā)到rip時,必須指明度量,即命令redistribute ospf 1 metric 10。
將rip重分發(fā)到ospf時,也必須指度量,并且使用subnets選項,否則R5看不到R3的路由。subnets選項可以確保RIP網(wǎng)絡(luò)中的無類子網(wǎng)路由能夠正確的被發(fā)布。
配置完成后,在R3、R5上可以看到彼此之間的路由了。
R3#sh ip route
……
2.0.0.0/24 is subnetted, 1 subnets
R 2.2.2.0 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/10] via 192.168.3.1, 00:00:08, FastEthernet1/3
5.0.0.0/32 is subnetted, 1 subnets
R 5.5.5.5 [120/10] via 192.168.3.1, 00:00:08, FastEthernet1/3
R 192.168.4.0/24 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
R 192.168.5.0/24 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:08, FastEthernet1/3
C 192.168.3.0/24 is directly connected, FastEthernet1/3
------------------------------------
R5#sh ip route
……
3.0.0.0/24 is subnetted, 1 subnets
O E2 3.3.3.0 [110/200] via 192.168.5.1, 00:00:43, FastEthernet1/5
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback0
O E2 192.168.4.0/24 [110/20] via 192.168.5.1, 01:38:10, FastEthernet1/5
C 192.168.5.0/24 is directly connected, FastEthernet1/5
O E2 192.168.2.0/24 [110/20] via 192.168.5.1, 01:38:10, FastEthernet1/5
O E2 192.168.3.0/24 [110/20] via 192.168.5.1, 01:38:10, FastEthernet1/5
------------------------------------
6、EIGRP與OSPF重分發(fā)
R1(config)#router eigrp 100
R1(config-router)#redistribute ospf 1 metric 10000 100 255 1 1500
R1(config-router)#exit
R1(config)#router ospf 1
R1(config-router)#redistribute eigrp 100 metric 200 subnets
------------------------------------
注意,如前面所說,將路由向eigrp重分發(fā)時,帶寬、延遲等五個參數(shù)一定要正確。將路由向ospf重分發(fā)時,后面要寫subnets選項。
配置完成后,在R4、R5上可以看到彼此之間的路由了。
R4#sh ip route
……
2.0.0.0/24 is subnetted, 1 subnets
D EX 2.2.2.0 [170/30720] via 192.168.4.1, 01:51:06, FastEthernet1/4
3.0.0.0/24 is subnetted, 1 subnets
D EX 3.3.3.0 [170/284160] via 192.168.4.1, 00:20:39, FastEthernet1/4
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
D EX 5.5.5.5 [170/284160] via 192.168.4.1, 00:03:03, FastEthernet1/4
C 192.168.4.0/24 is directly connected, FastEthernet1/4
D EX 192.168.5.0/24 [170/30720] via 192.168.4.1, 01:51:06, FastEthernet1/4
D EX 192.168.2.0/24 [170/30720] via 192.168.4.1, 01:51:06, FastEthernet1/4
D EX 192.168.3.0/24 [170/30720] via 192.168.4.1, 01:51:06, FastEthernet1/4
------------------------------------
R5#sh ip route
……
3.0.0.0/24 is subnetted, 1 subnets
O E2 3.3.3.0 [110/200] via 192.168.5.1, 00:07:21, FastEthernet1/5
4.0.0.0/24 is subnetted, 1 subnets
O E2 4.4.4.0 [110/200] via 192.168.5.1, 00:02:27, FastEthernet1/5
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback0
O E2 192.168.4.0/24 [110/20] via 192.168.5.1, 01:50:19, FastEthernet1/5
C 192.168.5.0/24 is directly connected, FastEthernet1/5
O E2 192.168.2.0/24 [110/20] via 192.168.5.1, 01:50:19, FastEthernet1/5
O E2 192.168.3.0/24 [110/20] via 192.168.5.1, 01:50:19, FastEthernet1/5
------------------------------------
至此,整個網(wǎng)絡(luò)實現(xiàn)互通。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)站名稱:Redistribute-創(chuàng)新互聯(lián)
URL網(wǎng)址:http://www.rwnh.cn/article0/cepeoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、網(wǎng)頁設(shè)計公司、網(wǎng)站維護、網(wǎng)站設(shè)計公司、外貿(mào)網(wǎng)站建設(shè)、做網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容