tft每日頭條

 > 圖文

 > 路由控制協議有幾種

路由控制協議有幾種

圖文 更新时间:2025-07-08 04:23:33
一、路由重分布

1、當許多運行多路由的網絡要集成到一起時,必須在這些不同的路由選擇協議之間共享路由信息。在路由選擇協議之間交換路 由信息的 過程被稱 為路由重分布

2、路由重分布為在同一個互聯網絡中高效地支持多種路由協議提供了可能,執行路由重分布的路由器被稱為邊界路由器,因為它們位于兩個或多個自治系統的邊界上。路由重分布時計量單位和管理距離是必須要考慮的。

二、RIP、EIGRP 和 OSPF 重分布1.目的

(1)種子度量值的配置

(2)路由重分布參數的配置

(3)靜态路由重分布

(4)RIP 和 EIGRP 的重分布

(5)EIGRP 和 OSPF 的重分布

(6)重分布路由的查看和調試

2.拓撲

路由控制協議有幾種(大型網絡中各種路由協議怎麼實現互聯互通)1

3.實驗步驟

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

R1(config)# router rip

R1(config-router)# version 2

R1(config-router)# no auto-summary

R1(config-router)# network 192.168.12.0

R1(config-router)# redistribute static metric 3 //重分布靜态路由

R1(config)#ip route 0.0.0.0 0.0.0.0 Serial0/0/1

ip route 0.0.0.0 0.0.0.0 Serial0/0/1

【注意】

在向 RIP 區域重分布路由的時候,必須指定度量值,或者通過“ default-metric”命

令設置缺省種子度量值,因為 RIP 默認種子度量值為無限大,但是隻有重分布靜态特殊,可

以不指定種子度量值。

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

R2(config)# router eigrp 1

R2(config-router)# no auto-summary

R2(config-router)# network 192.168.23.0

R2(config-router)# redistribute rip metric 1000 100 255 1 1500

//将 RIP 重分布到 EIGRP 中

【提示】

因為 EIGRP 的度量相對複雜,所以重分布時需要分别指定帶寬、延遲、可靠性、負載以

及 MTU 參數的值。

R2(config)# router rip

R2(config-router)# version 2

R2(config-router)# no auto-summary

R2(config-router)# network 192.168.12.0

R2(config-router) #redistribute eigrp 1 //将 EIGRP 重分布到 RIP 中

R2(config-router)# default-metric 4 //配置默認種子度量值

【注意】

在“ redistribute”命令中用參數“ metric”指定的種子度量值優先于路由模式下使

用“ default-metric”命令設定的缺省的種子度量值。

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

R3(config)# router eigrp 1

R3(config-router)# no auto-summary

R3(config-router)# network 3.3.3.0 0.0.0.255

R3(config-router)# network 192.168.23.0

R3(config-router)# redistribute ospf 1 metric 1000 100 255 1 1500

//将 OSPF 重分布到 EIGRP 中

R3(config-router)# distance eigrp 90 150 //配置 EIGRP 默認管理距離

R3(config)# router ospf 1

R3(config-router)# router-id 3.3.3.3

R3(config-router)# network 192.168.34.0 0.0.0.255 area 0

R3(config-router)# redistribute eigrp 1 metric 30 metric-type 1 subnets

//将 EIGRP 重分布到 OSPF 中

R3(config-router)#d efault-information originate always

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

R4(config)# router ospf 1

R4(config-router)# router-id 4.4.4.4

R4(config-router)# network 4.4.4.0 0.0.0.255 area 0

R4(config-router)# network 192.168.34.0 0.0.0.255 area 0

4.實驗調試

(1)在 R1 上查看路由表:

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, 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 0.0.0.0 to network 0.0.0.0

C 192.168.12.0/24 is directly connected, Serial0/0/0

3.0.0.0/24 is subnetted, 1 subnets

R 3.3.3.0 [120/4] via 192.168.12.2, 00:00:08, Serial0/0/0

4.0.0.0/32 is subnetted, 1 subnets

R 4.4.4.4 [120/4] via 192.168.12.2, 00:00:08, Serial0/0/0

C 202.96.134.0/24 is directly connected, Serial0/0/1

R 192.168.23.0/24 [120/4] via 192.168.12.2, 00:00:08, Serial0/0/0

R 192.168.34.0/24 [120/4] via 192.168.12.2, 00:00:08, Serial0/0/0

R 192.168.23.0/24 [120/4] via 192.168.12.2, 00:00:08, Serial0/0/0

R 192.168.34.0/24 [120/4] via 192.168.12.2, 00:00:08, Serial0/0/0

S* 0.0.0.0/0 is directly connected, Serial0/0/1

以上輸出表明路由器 R1 通過 RIPv2 學到從路由器 R2 重分布進 RIP 的路由。

(2)在 R2 上查看路由表:

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, 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 192.168.12.1 to network 0.0.0.0

C 192.168.12.0/24 is directly connected, Serial0/0/0

3.0.0.0/24 is subnetted, 1 subnets

D 3.3.3.0 [90/2297856] via 192.168.23.3, 00:00:21, Serial0/0/1

4.0.0.0/32 is subnetted, 1 subnets

D EX 4.4.4.4 [170/3097600] via 192.168.23.3, 00:00:21, Serial0/0/1

C 192.168.23.0/24 is directly connected, Serial0/0/1

D EX 192.168.34.0/24 [170/3097600] via 192.168.23.3, 00:00:21, Serial0/0/1

R* 0.0.0.0/0 [120/3] via 192.168.12.1, 00:00:05, Serial0/0/0

D EX 192.168.34.0/24 [170/3097600] via 192.168.23.3, 00:00:21, Serial0/0/1

R* 0.0.0.0/0 [120/3] via 192.168.12.1, 00:00:05, Serial0/0/0

以上輸出表明從路由器 R1 上重分布進 RIP 的默認路由被路由器 R2 學習到,路由代碼為

“ R*”;在路由器 R3 上重分布進來的 OSPF 路由也被路由器 R2 學習到,路由代碼為“ D EX”,

這也說明 EIGRP 能夠識别内部路由和外部路由,默認的時候,内部路由的管理距離是 90,

外部路由的管理距離是 170。

(3)在 R3 上查看路由表:

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, 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 192.168.23.2 to network 0.0.0.0

D EX 192.168.12.0/24 [150/3097600] via 192.168.23.2, 00:13:43, Serial0/0/1

3.0.0.0/24 is subnetted, 1 subnets

C 3.3.3.0 is directly connected, Loopback0

4.0.0.0/32 is subnetted, 1 subnets

O 4.4.4.4 [110/65] via 192.168.34.4, 00:13:43, Serial0/0/0

C 192.168.23.0/24 is directly connected, Serial0/0/1

C 192.168.34.0/24 is directly connected, Serial0/0/0

D*EX 0.0.0.0/0 [150/3097600] via 192.168.23.2, 00:06:08, Serial0/0/1

以上輸出表明,從路由器 R2 上重分布進 EIGRP 的路由被路由器 R3 學習到,路由代碼為

“ D*EX”,同時 EIGRP 外部路由的管理距離被修改成 150。

(4)在 R4 上查看路由表:

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, 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 192.168.34.3 to network 0.0.0.0

O E1 192.168.12.0/24 [110/94] via 192.168.34.3, 00:25:26, Serial0/0/0

3.0.0.0/24 is subnetted, 1 subnets

O E1 3.3.3.0 [110/94] via 192.168.34.3, 00:25:26, Serial0/0/0

4.0.0.0/24 is subnetted, 1 subnets

C 4.4.4.0 is directly connected, Loopback0

O E1 192.168.23.0/24 [110/94] via 192.168.34.3, 00:25:26, Serial0/0/0

C 192.168.34.0/24 is directly connected, Serial0/0/0

O*E2 0.0.0.0/0 [110/1] via 192.168.34.3, 00:25:26, Serial0/0/0

以上輸出表明,從路由器 R3 上重分布進 OSPF 的路由被路由器 R4 學習到,路由代碼為

“ O E1”;同時學到由 R3 注入的路由代碼為“ O E2”的默認路由。

(5) show ip protocols

R3# show ip protocols

Routing Protocol is " eigrp 1" // 運行 AS 為 1 的 EIGRP 進程

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Default networks flagged in outgoing updates

Default networks accepted from incoming updates

EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0

EIGRP maximum hopcount 100

EIGRP maximum metric variance 1

Redistributing: eigrp 1, ospf 1 (internal, external 1 & 2, nssa-external 1 & 2)

//将 OSPF 進程 1 重分布 EIGRP 中

EIGRP NSF-aware route hold timer is 240s

Automatic network summarization is not in effect

Maximum path: 4

Routing for Networks:

3.3.3.0/24

192.168.23.0

Routing Information Sources:

Gateway Distance Last Update

192.168.23.2 90 00:51:05

Distance: internal 90 external 150

Routing Protocol is " ospf 1" //運行 OSPF 進程,進程号為 1

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 3.3.3.3

It is an autonomous system boundary router //自治系統邊界路由器(ASBR)

Redistributing External Routes from,

eigrp 1 with metric mapped to 30, includes subnets in redistribution

Redistributing External Routes from,

eigrp 1 with metric mapped to 30, includes subnets in redistribution

//将 EIGRP1 重分布 OSPF 中

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

192.168.34.0 0.0.0.255 area 0

Routing Information Sources:

Gateway Distance Last Update

4.4.4.4 110 00:58:42

3.3.3.3 110 00:58:42

Distance: (default is 110)

以上輸出表明路由器 R3 運行 EIGRP 和 OSPF 兩種路由協議,而且實現了雙向重分布。

以下是華為數通路由交換方向完整技術分享,歡迎對華為網絡技術感興趣的小夥伴們訂閱。

【可在專欄中進行查看訂閱】

華為新版HCIA數通路由交換

華為新版HCIP數通路由交換

華為新版HCIE數通路由交換

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关圖文资讯推荐

热门圖文资讯推荐

网友关注

Copyright 2023-2025 - www.tftnews.com All Rights Reserved