多動態路由協議之間的兼容

在一些網絡中,由於某種需要,配置多個動態學習路由協議,而在默認情況下各個路由協議之間不能互相學習路由信息(末梢路由器除外),那就需要我們通過手工配置實現路由器間互相學習路由信息。

在單協議網絡中,路由協議是把本地網段通告給本路由協議,在多協議的網絡中,在中間的路由器把本地網段通告給其他路由協議,即路由重分發

路由重分佈的作用:可以使得多種路由協議之間,多重廠商環境中進行路由信息交換

模擬實驗環境:IP分佈和拓撲如圖

clip_image002

根據拓撲圖,我們可以實現RIPV2、EIGRP、OSPF之間的兼容

配置命令:

router(config)#router 路由協議 參數

router(config-router)#network XXXX 通告本地網段

router(config-router)# redistribute 路由協議2 參數 metric 度量值

實驗步驟:

1、根據實驗圖配置基本步驟 略

2、配置路由器1 配置RIPV2路由協議

r1(config)#router rip //配置RIPV2

r1(config-router)#version 2

r1(config-router)#network 172.1.1.0

r1(config-router)#network 1.1.1.0

3、配置路由器3

r3(config)#router eigrp 10 //配置EIGRP AS=10

r3(config-router)#network 172.2.1.0

r3(config-router)#network 2.2.2.0

4、配置路由器4

r4(config)#router ospf 1 //配置OSPF AREA=0

r4(config-router)#network 172.3.1.0 0.0.0.255 area 0

r4(config-router)#network 3.3.3.0 0.0.0.255 area 0

5、配置路由器2

r2(config)#router rip

r2(config-router)#version 2

r2(config-router)#network 172.1.1.0

r2(config-router)#network 172.2.1.0

r2(config-router)#network 172.3.1.0

r2(config-router)#redistribute eigrp 10 metric 1

//EIGRP向RIPV2重定向,10爲AS號,跳數是1

r2(config-router)#redistribute ospf 1 metric 1

//OSPF向RIPV2重定向,OSPF 1爲進程號 metric 1爲跳數

r2(config)#router eigrp 10

r2(config-router)#network 172.1.1.0

r2(config-router)#network 172.2.1.0

r2(config-router)#network 172.3.1.0

r2(config-router)#redistribute rip metric 1544 20000 255 1 1500 //RIP向EIGRP重定向

r2(config-router)#redistribute ospf 1 metric 1544 20000 255 1 1500 //OSPF向EIGRP重定向

metric 後面值依次爲:帶寬、延遲、可靠性、負載、MTU

注意:順序不能改變

r2(config)#router ospf 1

r2(config-router)#network 172.1.1.0 0.0.0.255 area 0

r2(config-router)#network 172.2.1.0 0.0.0.255 area 0

r2(config-router)#network 172.3.1.0 0.0.0.255 area 0

r2(config-router)#redistribute rip metric 100 subnets

r2(config-router)#redistribute eigrp 10 metric 100 subnets

//metric 100 爲COST 值

六、測試聯通性

在路由器1上查看路由表

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 2.0.0.0/8 [120/1] via 172.1.1.1, 00:00:24, Serial0/0

R 3.0.0.0/8 [120/1] via 172.1.1.1, 00:00:24, Serial0/0

172.1.0.0/16 is variably subnetted, 2 subnets, 2 masks

C 172.1.1.0/24 is directly connected, Serial0/0

R 172.1.0.0/16 [120/1] via 172.1.1.1, 00:00:24, Serial0/0

R 172.2.0.0/16 [120/1] via 172.1.1.1, 00:00:24, Serial0/0

R 172.3.0.0/16 [120/1] via 172.1.1.1, 00:00:24, Serial0/0

在路由器2上查看路由表

r2#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

R 1.0.0.0/8 [120/1] via 172.1.1.2, 00:00:06, Serial0/0

D 2.0.0.0/8 [90/2297856] via 172.2.1.2, 00:03:59, Serial0/1

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 172.3.1.2, 00:02:35, Serial0/2

172.1.0.0/16 is variably subnetted, 2 subnets, 2 masks

C 172.1.1.0/24 is directly connected, Serial0/0

D 172.1.0.0/16 is a summary, 00:03:59, Null0

172.2.0.0/16 is variably subnetted, 2 subnets, 2 masks

D 172.2.0.0/16 is a summary, 00:03:59, Null0

C 172.2.1.0/24 is directly connected, Serial0/1

172.3.0.0/16 is variably subnetted, 2 subnets, 2 masks

C 172.3.1.0/24 is directly connected, Serial0/2

D 172.3.0.0/16 is a summary, 00:03:55, Null0

在路由器3上查看路由表

r3#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

D EX 1.0.0.0/8 [170/7289856] via 172.2.1.1, 00:03:56, Serial0/0

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

C 2.2.2.0/24 is directly connected, Loopback0

D 2.0.0.0/8 is a summary, 00:04:40, Null0

3.0.0.0/32 is subnetted, 1 subnets

D EX 3.3.3.3 [170/7289856] via 172.2.1.1, 00:03:07, Serial0/0

D 172.1.0.0/16 [90/2681856] via 172.2.1.1, 00:04:31, Serial0/0

172.2.0.0/16 is variably subnetted, 2 subnets, 2 masks

D 172.2.0.0/16 is a summary, 00:04:40, Null0

C 172.2.1.0/24 is directly connected, Serial0/0

D 172.3.0.0/16 [90/2681856] via 172.2.1.1, 00:04:27, Serial0/0

在路由器4上查看路由表

r4#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

O E2 1.0.0.0/8 [110/100] via 172.3.1.1, 00:03:35, Serial0/0

O E2 2.0.0.0/8 [110/100] via 172.3.1.1, 00:03:35, Serial0/0

3.0.0.0/24 is subnetted, 1 subnets

C 3.3.3.0 is directly connected, Loopback0

172.1.0.0/16 is variably subnetted, 2 subnets, 2 masks

O 172.1.1.0/24 [110/128] via 172.3.1.1, 00:03:35, Serial0/0

O E2 172.1.0.0/16 [110/100] via 172.3.1.1, 00:03:35, Serial0/0

172.2.0.0/16 is variably subnetted, 2 subnets, 2 masks

O E2 172.2.0.0/16 [110/100] via 172.3.1.1, 00:03:35, Serial0/0

O 172.2.1.0/24 [110/128] via 172.3.1.1, 00:03:35, Serial0/0

172.3.0.0/16 is variably subnetted, 2 subnets, 2 masks

C 172.3.1.0/24 is directly connected, Serial0/0

O E2 172.3.0.0/16 [110/100] via 172.3.1.1, 00:03:35, Serial0/0

利用PING命令測試

r1#ping 2.2.2.2 source 1.1.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

Packet sent with a source address of 1.1.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 68/123/208 ms

r1#ping 3.3.3.3 source 1.1.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

Packet sent with a source address of 1.1.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 52/105/200 ms

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章