溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

自制MPLS解決路由黑洞的示例分析

發(fā)布時(shí)間:2021-12-06 14:00:05 來(lái)源:億速云 閱讀:186 作者:柒染 欄目:云計(jì)算

本篇文章給大家分享的是有關(guān)自制MPLS解決路由黑洞的示例分析,小編覺(jué)得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話(huà)不多說(shuō),跟著小編一起來(lái)看看吧。

利用mpls解決BGP路由黑洞配置命令全解析

——By Jim

什么是BGP路由黑洞?

BGP規(guī)定無(wú)論路由器是否啟動(dòng)bgp都要無(wú)條件地轉(zhuǎn)發(fā)BGP消息和更新包(凌駕于IGP之上),違背了IGP"非igp路由器阻斷igp域"的原則,因而輾轉(zhuǎn)造成了BGP路由器"居然ping不通路由表中的條目"的現(xiàn)象,也就是所謂的路由黑洞。

本實(shí)驗(yàn)用gns3模擬器3640路由器完成,筆者將配置全拷貝,讀者按圖搭建拓?fù)浜笾苯佑覔魪?fù)制命令行即可完成實(shí)驗(yàn)。

實(shí)驗(yàn)拓?fù)洌?/strong>

第一步:底層基礎(chǔ)配置

R1:

int e0/1

no shu

ip add 12.12.12.1 255.255.255.0

int loo 0

ip add 1.1.1.1 255.255.255.0

int loo 100

ip add 100.100.100.1 255.255.255.0

router os 1

router-id 1.1.1.1

net 12.12.12.1 255.255.255.0 a 0

net 1.1.1.1 255.255.255.0 a 0

!

!

R2:

int e0/1

no shu

ip add 12.12.12.2 255.255.255.0

int e0/2

no shu

ip add 23.23.23.2 255.255.255.0

no shu

int loo 0

ip add 2.2.2.2 255.255.255.0

router os 1

router-id 2.2.2.2

net 12.12.12.2 255.255.255.0 a 0

net 2.2.2.2 255.255.255.0 a 0

net 23.23.23.2 255.255.255.0 a 0

!

!

R3:

int e0/1

ip add 23.23.23.3 255.255.255.0

int e0/2

ip add 34.34.34.3 255.255.255.0

int lo 0

ip add 3.3.3.3 255.255.255.0

router os 1

router-id 3.3.3.3

net 23.23.23.3 255.255.255.0 a 0

net 34.34.34.3 255.255.255.0 a 0

net 3.3.3.3 255.255.255.0 a 0

!

!

R4

int e0/1

no shu

ip add 34.34.34.4 255.255.255.0

int e0/2

no shu

ip add 45.45.45.4 255.255.255.0

int loo 0

ip add 4.4.4.4 255.255.255.0

ROUTER OS 1

router-id 4.4.4.4

net 34.34.34.4 255.255.255.0 a 0

net 45.45.45.4 255.255.255.0 a 0

net 4.4.4.4 255.255.255.0 a 0

!

!

R5

int e0/1

no shu

ip add 45.45.45.5 255.255.255.0

int loo 0

ip add 5.5.5.5 255.255.255.0

int loo 200

ip add 200.200.200.1 255.255.255.0

router os 1

router-id 5.5.5.5

net 45.45.45.5 255.255.255.0 a 0

net 5.5.5.5 255.255.255.0 a 0

!

!

!

!

第二步:進(jìn)行bgp的配置

R1

router bgp 12345

no au

no syn

bgp router-id 1.1.1.1

neighbor 5.5.5.5 remote-as 12345

neighbor 5.5.5.5 update-source loo 0

neighbor 5.5.5.5 next-hop-self

net 100.100.100.0 mask 255.255.255.0

!

!

R5:

router bgp 12345

no au

no syn

bgp router-id 5.5.5.5

neighbor 1.1.1.1 remote-as 12345

neighbor 1.1.1.1 update-source loopback 0

neighbor 1.1.1.1 next-hop-self

net 200.200.200.0 mask 255.255.255.0

!

!

=====================================================================

!

!

第三步:校驗(yàn)

R1#show ip route bgp

B 200.200.200.0/24 [200/0] via 5.5.5.5, 00:55:29

R5#show ip route bgp

100.0.0.0/24 is subnetted, 1 subnets

B 100.100.100.0 [200/0] via 1.1.1.1, 00:57:47

此時(shí)R1和R5都通過(guò)BGP學(xué)到了AS外的路由。

但是?。?!

R1#ping 200.200.200.0

Type escape sequence to abort.

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

UUUUU

Success rate is 0 percent (0/5)

!

R1#trace 200.200.200.0

Type escape sequence to abort.

Tracing the route to 200.200.200.0

1 12.12.12.2 36 msec 56 msec 16 msec

2 12.12.12.2 !H !H !H

同理,R5也ping不通100.100.100.0,直接原因都是卡在第一條。

根本原因:出現(xiàn)了路由黑洞,R2R3R4上沒(méi)有自治系統(tǒng)外的路由條目,收到該路由包直接丟棄!

第四步:配置mpls ldp

R1:

mpls ldp router-id loopback 0

mpls label range 100 199

int e0/1

mpls ip

!

!

R2:

mpls ldp router-id loopback 0

mpls label range 200 299

int e0/1

mpls ip

int e0/2

mpls ip

!

!

!

R3:

mpls ldp router-id loopback 0

mpls label range 300 399

int e0/1

mpls ip

int e0/2

mpls ip

!

!

!

R4:

mpls ldp router-id loopback 0

mpls label range 400 499

int e0/1

mpls ip

int e0/2

mpls ip

!

!

!

!

R5:

mpls ldp router-id loo 0

mpls label range 500 599

int e0/1

mpls ip

=====================================================================

第五步:驗(yàn)證

R1#ping 200.200.200.0

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 104/128/176 ms

!

!

R1#trace 200.200.200.0

Type escape sequence to abort.

Tracing the route to 200.200.200.0

1 12.12.12.2 [MPLS: Label 204 Exp 0] 120 msec 112 msec 136 msec

2 23.23.23.3 [MPLS: Label 303 Exp 0] 124 msec 120 msec 128 msec

3 34.34.34.4 [MPLS: Label 403 Exp 0] 108 msec 92 msec 112 msec

4 45.45.45.5 124 msec 140 msec 124 msec

同理R5也能ping通100.100.100.0

以上就是自制MPLS解決路由黑洞的示例分析,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見(jiàn)到或用到的。希望你能通過(guò)這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注億速云行業(yè)資訊頻道。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI