BGP/MPLS *** Option B 跨域研究實驗

1、實驗環境
以華爲模擬器eNSP爲實驗環境,結合wireshark抓包進行BGP/MPLS *** OptionA 控制層面、數據層面以及日常排錯三個方面進行研究;如下圖所示:
BGP/MPLS *** Option B 跨域研究實驗
BGP/MPLS *** Option B 跨域研究實驗

2、配置流程
1)配置IGP與公網MPLS LDP隧道:
① ISP1
PE1:
router id 1.1.1.1
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 12.12.12.0 0.0.0.255
mpls lsr-id 1.1.1.1
mpls
mpls ldp
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
mpls
mpls ldp
interface GigabitEthernet0/0/0
ip address 12.12.12.1 255.255.255.0
mpls
mpls ldp
P1:
router id 2.2.2.2
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.12.12.0 0.0.0.255
network 23.23.23.0 0.0.0.255
mpls lsr-id 2.2.2.2
mpls
mpls ldp
ip address 2.2.2.2 255.255.255.255
mpls
mpls ldp
interface GigabitEthernet0/0/0
ip address 12.12.12.2 255.255.255.0
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 23.23.23.2 255.255.255.0
mpls
mpls ldp
ASBR1:
router id 3.3.3.3
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.23.23.0 0.0.0.255
mpls lsr-id 3.3.3.3
mpls
mpls ldp
ip address 3.3.3.3 255.255.255.255
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 23.23.23.3 255.255.255.0
mpls
mpls ldp
查看公網路有:
<ASBR1>dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib

Public routing table : OSPF
Destinations : 3 Routes : 3

OSPF routing table status : <Active>
Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost Flags NextHop Interface

    1.1.1.1/32  OSPF    10   2           D   23.23.23.2      GigabitEthernet

0/0/1
2.2.2.2/32 OSPF 10 1 D 23.23.23.2 GigabitEthernet
0/0/1
12.12.12.0/24 OSPF 10 2 D 23.23.23.2 GigabitEthernet
0/0/1

OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
查看MPLS LDP session:
<ASBR1>dis mpls ldp session

LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.

PeerID Status LAM SsnRole SsnAge KASent/Rcv

2.2.2.2:0 Operational DU Active 0000:00:18 75/75

TOTAL: 1 session(s) Found.
查看MPLS LSP:
<ASBR1>dis mpls lsp

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
1.1.1.1/32 NULL/1024 -/GE0/0/1
1.1.1.1/32 1024/1024 -/GE0/0/1
2.2.2.2/32 NULL/3 -/GE0/0/1
2.2.2.2/32 1025/3 -/GE0/0/1
3.3.3.3/32 3/NULL -/-
②ISP2
PE2:
router id 6.6.6.6
ospf 2
area 0.0.0.0
network 6.6.6.6 0.0.0.0
network 56.56.56.0 0.0.0.255
mpls lsr-id 6.6.6.6
mpls
mpls ldp
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
mpls
mpls ldp
interface GigabitEthernet0/0/0
ip address 56.56.56.6 255.255.255.0
mpls
mpls ldp
P2:
router id 5.5.5.5
ospf 2
area 0.0.0.0
network 5.5.5.5 0.0.0.0
network 56.56.56.0 0.0.0.255
network 45.45.45.0 0.0.0.255
mpls lsr-id 5.5.5.5
mpls
mpls ldp
ip address 5.5.5.5 255.255.255.255
mpls
mpls ldp
interface GigabitEthernet0/0/0
ip address 56.56.56.5 255.255.255.0
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 45.45.45.5 255.255.255.0
mpls
mpls ldp
ASBR2:
router id 4.4.4.4
ospf 2
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 45.45.45.0 0.0.0.255
mpls lsr-id 4.4.4.4
mpls
mpls ldp
ip address 4.4.4.4 255.255.255.255
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 45.45.45.4 255.255.255.0
mpls
mpls ldp
查看公網路有:
<ASBR2>dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib

Public routing table : OSPF
Destinations : 3 Routes : 3

OSPF routing table status : <Active>
Destinations : 3 Routes : 3

Destination/Mask Proto Pre Cost Flags NextHop Interface

    5.5.5.5/32  OSPF    10   1           D   45.45.45.5      GigabitEthernet

0/0/1
6.6.6.6/32 OSPF 10 2 D 45.45.45.5 GigabitEthernet
0/0/1
56.56.56.0/24 OSPF 10 2 D 45.45.45.5 GigabitEthernet
0/0/1

OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
查看MPLS LDP session:
<ASBR2>dis mpls ldp session

LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.

PeerID Status LAM SsnRole SsnAge KASent/Rcv

5.5.5.5:0 Operational DU Passive 0000:00:24 100/100

TOTAL: 1 session(s) Found.
查看MPLS LSP:
<ASBR2>dis mpls lsp

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
4.4.4.4/32 3/NULL -/-
5.5.5.5/32 NULL/3 -/GE0/0/1
5.5.5.5/32 1024/3 -/GE0/0/1
6.6.6.6/32 NULL/1025 -/GE0/0/1
6.6.6.6/32 1025/1025 -/GE0/0/1
2)配置各個站點CE與PE的***實例:
①ISP1:
PE1:
ip ***-instance spi
ipv4-family
route-distinguisher 100:1
***-target 100:1 export-extcommunity
***-target 100:1 import-extcommunity
interface GigabitEthernet0/0/1
ip binding ***-instance spi
ip address 192.168.1.254 255.255.255.0
ip ***-instance spd
ipv4-family
route-distinguisher 200:1
***-target 200:1 export-extcommunity
***-target 200:1 import-extcommunity
interface GigabitEthernet0/0/2
ip binding ***-instance spd
ip address 10.10.1.254 255.255.255.0
ping測試站點到網關
②ISP2
PE2:
ip ***-instance spi
ipv4-family
route-distinguisher 100:1
***-target 100:1 export-extcommunity
***-target 100:1 import-extcommunity
interface GigabitEthernet0/0/1
ip binding ***-instance spi
ip address 192.168.2.254 255.255.255.0
ip ***-instance spd
ipv4-family
route-distinguisher 200:1
***-target 200:1 export-extcommunity
***-target 200:1 import-extcommunity
interface GigabitEthernet0/0/2
ip binding ***-instance spd
ip address 10.10.2.254 255.255.255.0
ping測試站點到網關
3)配置MP-BGP在PE與ASBR之間傳遞***V4站點***V4私網路由:
①ISP1
建立MP-BGP連接:
PE1:
bgp 100
undo default ipv4-unicast
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
ipv4-family ***v4
policy ***-target
peer 3.3.3.3 enable
ASBR1:
bgp 100
undo default ipv4-unicast
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
ipv4-family ***v4
policy ***-target
peer 1.1.1.1 enable
查看MP-BGP建立連接情況:
[ASBR1]dis bgp ***v4 all peer
BGP local router ID : 3.3.3.3
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv

1.1.1.1 4 100 9 9 0 00:07:51 Established 0
宣告***路有到MP-BGP:
PE1:
ipv4-family ***-instance spd
network 10.10.1.0 255.255.255.0
ipv4-family ***-instance spi
network 192.168.1.0
查看***v4私網路由路有從PE1傳遞到ASBR1情況:
<ASBR1>dis bgp ***v4 all routing-table
BGP Local router ID is 3.3.3.3
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 2
Route Distinguisher: 100:1

  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

*>i 192.168.1.0 1.1.1.1 0 100 0 i

Route Distinguisher: 200:1

  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

*>i 10.10.1.0/24 1.1.1.1 0 100 0 i

***-Instance spd, Router ID 3.3.3.3:

Total Number of Routes: 1
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.10.1.0/24 1.1.1.1 0 100 0 i

***-Instance spi, Router ID 3.3.3.3:

Total Number of Routes: 1
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 192.168.1.0 1.1.1.1 0 100 0 i

①ISP2
建立MP-BGP連接:
PE2:
bgp 200
undo default ipv4-unicast
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 4.4.4.4 enable
ipv4-family ***v4
policy ***-target
peer 4.4.4.4 enable
ASBR2:
bgp 200
undo default ipv4-unicast
peer 6.6.6.6 as-number 200
peer 6.6.6.6 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 6.6.6.6 enable
ipv4-family ***v4
policy ***-target
peer 6.6.6.6 enable
<ASBR2>dis bgp ***v4 all peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv

6.6.6.6 4 200 3 3 0 00:01:55 Established 0
宣告***路有到MP-BGP:
PE2
ipv4-family ***-instance spd
network 10.10.2.0 255.255.255.0
ipv4-family ***-instance spi
network 192.168.2.0
查看***v4私網路由路有從PE2傳遞到ASBR2情況:
<ASBR2>dis bgp ***v4 all routing-table
BGP Local router ID is 4.4.4.4
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total number of routes from all PE: 2
Route Distinguisher: 100:1

  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

*>i 192.168.2.0 6.6.6.6 0 100 0 i

Route Distinguisher: 200:1

  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

*>i 10.10.2.0/24 6.6.6.6 0 100 0 i

***-Instance spd, Router ID 4.4.4.4:

Total Number of Routes: 1
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.10.2.0/24 6.6.6.6 0 100 0 i

***-Instance spi, Router ID 4.4.4.4:

Total Number of Routes: 1
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 192.168.2.0 6.6.6.6 0 100 0 i
4)進行ASBR1與ASBR2 的OPTION B跨域配置:
①ISP1
ASBR1:
interface GigabitEthernet0/0/0
ip address 34.34.34.3 255.255.255.0
Ping 測對端接口地址
②ISP2
ASBR2:
interface GigabitEthernet0/0/0
ip address 34.34.34.4 255.255.255.0
Ping 測對端接口地址
ASBR1與ASBR2建立MP-EBGP傳遞各自PE MP-IBGP傳來的路由:
ASBR1:
bgp 100
undo default ipv4-unicast
peer 34.34.34.4 as-number 200
ipv4-family unicast
undo peer 34.34.34.4 enable
ipv4-family ***v4
policy ***-target
peer 34.34.34.4 enable
ASBR2:
bgp 200
undo default ipv4-unicast
peer 34.34.34.3 as-number 100
ipv4-family unicast
undo synchronization
undo peer 34.34.34.3 enable
ipv4-family ***v4
policy ***-target
peer 34.34.34.3 enable
配置完成後發現ASBR1與ASBR2收不到任何***V4的路由,但是各自的PE1與PE2都已經發送***V4路由如下圖:
BGP/MPLS *** Option B 跨域研究實驗
BGP/MPLS *** Option B 跨域研究實驗

由於ASBR1與ASBR2上已經沒有*** 實例,在控制層面MP-IBGP接收路由需要BGP的***V4地址簇中對RT值進行過濾;所以在ASBR1與ASBR2上MP-BGP的***V4地址簇中把policy ***-target undo掉。
BGP/MPLS *** Option B 跨域研究實驗
但是發現PE1上接收不到ASBR1發送過來的192.168.2.0的路由如圖:
BGP/MPLS *** Option B 跨域研究實驗
BGP/MPLS *** Option B 跨域研究實驗

排查發現ASBR1沒有收到ASBR2上發來的路由:
BGP/MPLS *** Option B 跨域研究實驗

在ASBR1上排查發現:
BGP/MPLS *** Option B 跨域研究實驗
192.168.2.0/24的路由只有出去的標籤,只有ASBR2給分發的標籤,沒有ASBR1分發的標籤,所以它不轉發給PE1;
BGP/MPLS *** Option B 跨域研究實驗
注意:如果通過PE MP-BGP把私網路由傳給ASBR或其它設備,如果該設備上沒有起任何對應***實例,該設備無法接收對應該實例***V4路由,要想接收把***-target過濾關掉,如果採用Option B跨域注意兩個ASBR互聯接口使能MPLS,否則ASBR完不成標籤交換不會把***V4路由發出!
所以在ASBR1與ASBR2上使能MPLS,注意只需要使能MPLS,使得ASBR1 MP-IBGP與MP-EBGP能夠交換標籤,那麼ASBR1會給發給PE1的192.168.2.0打上標籤;
ASBR1:

BGP/MPLS *** Option B 跨域研究實驗
BGP/MPLS *** Option B 跨域研究實驗
BGP/MPLS *** Option B 跨域研究實驗

PE1:
Destination: 192.168.2.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 3.3.3.3 Neighbour: 3.3.3.3
State: Active Adv Relied Age: 00h03m24s
Tag: 0 Priority: low
Label: 1029 QoSInfo: 0x0
IndirectID: 0x4
RelayNextHop: 12.12.12.2 Interface: GigabitEthernet0/0/0
TunnelID: 0x3 Flags: RD

3、控制層面分析

1)CE3的路由192.168.2.0/24傳遞給CE1過程:
①PE2上連接CE3直連路由:
<PE2>dis ip routing-table ***-instance spi protocol direct
Route Flags: R - relay, D - download to fib

spi routing table : Direct
Destinations : 4 Routes : 4

Direct routing table status : <Active>
Destinations : 4 Routes : 4

Destination/Mask Proto Pre Cost Flags NextHop Interface

192.168.2.0/24  Direct  0    0           D   192.168.2.254   GigabitEthernet

0/0/1
192.168.2.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Direct routing table status : <Inactive>
Destinations : 0 Routes : 0
<PE2>dis ip routing-table ***-instance spi verbose
Destination: 192.168.2.0/24
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 192.168.2.254 Neighbour: 0.0.0.0
State: Active Adv Age: 03h29m00s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/1
TunnelID: 0x0 Flags: D

②把*** spi中192.168.2.0直連路由導入MP-BGP中:
<PE2>dis current-configuration configuration bgp
[V200R003C00]
bgp 200
undo default ipv4-unicast
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 4.4.4.4 enable
ipv4-family ***v4
policy ***-target
peer 4.4.4.4 enable
ipv4-family ***-instance spi
network 192.168.2.0
③PE2 在MP-BGP中192.168.2.0/24路由情況:
<PE2>dis bgp ***v4 ***-instance spi routing-table label

BGP Local router ID is 6.6.6.6
Status codes: - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 5
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.2.0 192.168.2.254 1026/NULL
<PE2>dis bgp ***v4 ***-instance spi routing-table 192.168.2.0

BGP local router ID : 6.6.6.6
Local AS number : 200

***-Instance spi, Router ID 6.6.6.6:
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 192.168.2.0/24:
Network route.
From: 0.0.0.0 (0.0.0.0)
Route Duration: 02h05m43s
Direct Out-interface: GigabitEthernet0/0/1
Original nexthop: 192.168.2.254
Qos information : 0x0
AS-path Nil, origin igp, MED 0, pref-val 0, valid, local, best, select, pre 0
Not advertised to any peer yet
PE2上的MP-BGP給192.168.2.0的***v4路由分配的私網標籤:
<PE2>dis bgp ***v4 all routing-table label

BGP Local router ID is 6.6.6.6
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total number of routes from all PE: 4

Route Distinguisher: 100:1
Network NextHop In/Out Label

>i 192.168.1.0 4.4.4.4 NULL/1029
> 192.168.2.0 192.168.2.254 1026/NULL
④ASBR2 在MP-BGP中收到192.168.2.0/24路由情況:
ASBR2上收到PE2 MP-IBGP 192.168.2.0 的***V4路由分的標籤1026
ASBR 2上與ASBR1的 MP-EBGP給192.168.2.0 的***V4路由分的1026
<ASBR2>dis bgp ***v4 all routing-table label

BGP Local router ID is 4.4.4.4
Status codes: - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 4
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.1.0 34.34.34.3 1029/1027
*>i 192.168.2.0 6.6.6.6 1026/1026
ASBR2到6.6.6.6的公網MPLS標籤:
<ASBR2>dis mpls lsp

             LSP Information: L3***  LSP

FEC In/Out Label In/Out IF Vrf Name
192.168.2.0/24 1026/1026 -/- ASBR LSP
10.10.2.0/24 1027/1027 -/- ASBR LSP
10.10.1.0/24 1028/1026 -/- ASBR LSP
192.168.1.0/24 1029/1027 -/- ASBR LSP

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
4.4.4.4/32 3/NULL -/-
5.5.5.5/32 NULL/3 -/GE0/0/1
5.5.5.5/32 1024/3 -/GE0/0/1
6.6.6.6/32 NULL/1025 -/GE0/0/1
6.6.6.6/32 1025/1025 -/GE0/0/1
<P2>dis mpls lsp

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
4.4.4.4/32 NULL/3 -/GE0/0/1
4.4.4.4/32 1024/3 -/GE0/0/1
5.5.5.5/32 3/NULL -/-
6.6.6.6/32 NULL/3 -/GE0/0/0
6.6.6.6/32 1025/3 -/GE0/0/0
⑤ 在ASBR1上進行查收192.168.2.0/24路由情況:
ASBR 2上與ASBR1的 MP-EBGP給192.168.2.0 的***V4路由分的1026
ASBR1上與PE1 的MP-IBGP給192.168.2.0 的***V4路由分的標籤1029
<ASBR1>dis bgp ***v4 all routing-table label

BGP Local router ID is 3.3.3.3
Status codes: - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 4
Route Distinguisher: 100:1
Network NextHop In/Out Label
>i 192.168.1.0 1.1.1.1 1027/1027
> 192.168.2.0 34.34.34.4 1029/1026
⑥ 在PE1上進行查收192.168.2.0/24路由情況:
<PE1>dis bgp ***v4 all routing-table label
ASBR1上與PE1 的MP-IBGP給192.168.2.0 的***V4路由分的標籤1029
BGP Local router ID is 1.1.1.1
Status codes:
- valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 4
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.1.0 192.168.1.254 1027/NULL
>i 192.168.2.0 3.3.3.3 NULL/1029
PE1上到3.3.3.3的FIB表:
<PE1>dis fib 3.3.3.3
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
3.3.3.3/32 12.12.12.2 DGHU t[99] GE0/0/0 0x3
PE1到3.3.3.3的公網標籤:
<PE1>dis mpls lsp

             LSP Information: BGP  LSP

FEC In/Out Label In/Out IF Vrf Name
10.10.1.0/24 1026/NULL -/- spd
192.168.1.0/24 1027/NULL -/- spi

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
2.2.2.2/32 NULL/3 -/GE0/0/0
2.2.2.2/32 1024/3 -/GE0/0/0
1.1.1.1/32 3/NULL -/-
3.3.3.3/32 NULL/1025 -/GE0/0/0
3.3.3.3/32 1025/1025 -/GE0/0/0

4、數據層面分析
1)CE1到CE3的192.168.2.1數據轉發分析:
① PC1 192.168.1.1 到網關PE1上的192.168.1.254;
② 在PE1上查詢spi ***實例的路由表查到到192.168.2.0 下一跳爲3.3.3.3;私網標籤爲1028;
③ 路由迭代,查找到路由如下:
<PE1>dis ip routing-table 3.3.3.3
Route Flags: R - relay, D - download to fib

Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
3.3.3.3/32 OSPF 10 2 D 12.12.12.2 GigabitEthernet0/0/0
<PE1>dis fib 3.3.3.3
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
3.3.3.3/32 12.12.12.2 DGHU t[1597] GE0/0/0 0x3
④MPLS ldp 爲 3.3.3.3/32路由分配的公網標籤爲1025:
<PE1>dis mpls lsp

             LSP Information: BGP  LSP

FEC In/Out Label In/Out IF Vrf Name
192.168.1.0/24 1026/NULL -/- spi
10.10.1.0/24 1027/NULL -/- spd

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
2.2.2.2/32 NULL/3 -/GE0/0/0
2.2.2.2/32 1024/3 -/GE0/0/0
1.1.1.1/32 3/NULL -/-
3.3.3.3/32 NULL/1025 -/GE0/0/0
3.3.3.3/32 1025/1025 -/GE0/0/0
⑤ 在PE1上進行查收192.168.2.0/24私網路由與標籤情況:
<PE1>dis bgp ***v4 all routing-table label
ASBR1上與PE1 的MP-IBGP給192.168.2.0 的***V4路由分的標籤1029
BGP Local router ID is 1.1.1.1
Status codes: - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 4
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.1.0 192.168.1.254 1027/NULL
*>i 192.168.2.0 3.3.3.3 NULL/1029

④ 去往192.168.2.1的數據包在PE1上G0/0/0封裝如圖所示BGP/MPLS *** Option B 跨域研究實驗;

PE1的G0/0/0上使能了MPLS,所以進行MPLS2.5層標籤轉發;
⑤ 在P1上查看標籤路徑:
<P1>dis fib 3.3.3.3
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
3.3.3.3/32 23.23.23.3 DGHU t[1589] GE0/0/1 0x3
<P1>dis mpls lsp

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
2.2.2.2/32 3/NULL -/-
1.1.1.1/32 NULL/3 -/GE0/0/0
1.1.1.1/32 1024/3 -/GE0/0/0
3.3.3.3/32 NULL/3 -/GE0/0/1
3.3.3.3/32 1025/3 -/GE0/0/1
把公網標籤1025換爲3
發現一個3這個特殊標籤,在離開P1時發生第二跳標籤彈出,把3的標籤也彈出;
在P1離開接口G0/0/1上抓包發現只留私網標籤1029:
BGP/MPLS *** Option B 跨域研究實驗
⑥ 在ASBR1上BGP路由中發現標籤爲:
ASBR2上收到ASBR2 MP-EBGP 192.168.2.0 的***V4路由分的標籤1026
ASBR1上與PE1 的MP-IBGP給192.168.2.0 的***V4路由分的標籤1029
<ASBR1>dis bgp ***v4 all routing-table label

BGP Local router ID is 3.3.3.3
Status codes: - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 4
Route Distinguisher: 100:1
Network NextHop In/Out Label
>i 192.168.1.0 1.1.1.1 1027/1027
*> 192.168.2.0 34.34.34.4 1029/1026
通過1029的標籤發現哪個***實例(MP-BGP分發的是私網標籤,用於在PE上指導私網數據從BGP ***V4的標籤表剝離標籤後轉移至對應的vrf);
⑦去往192.168.2.1報文進入spi VRF路由表並從G0/0/1上出去到ASBR2:
只剩下ASBR2與ASBR1分的MP-EBGP給192.168.2.0 的***V4路由分的標籤1026
BGP/MPLS *** Option B 跨域研究實驗
⑧去往192.168.2.1報文進入ASBR2:
ASBR2上收到PE2 MP-IBGP 192.168.2.0 的***V4路由分的標籤1026
ASBR 2上與ASBR1的 MP-EBGP給192.168.2.0 的***V4路由分的1026
<ASBR2>dis bgp ***v4 all routing-table label

BGP Local router ID is 4.4.4.4
Status codes: - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total number of routes from all PE: 4
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.1.0 34.34.34.3 1029/1027
*>i 192.168.2.0 6.6.6.6 1026/1026
ASBR2到6.6.6.6的公網MPLS標籤:
<ASBR2>dis mpls lsp

             LSP Information: L3***  LSP

FEC In/Out Label In/Out IF Vrf Name
192.168.2.0/24 1026/1026 -/- ASBR LSP
10.10.2.0/24 1027/1027 -/- ASBR LSP
10.10.1.0/24 1028/1026 -/- ASBR LSP
192.168.1.0/24 1029/1027 -/- ASBR LSP

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
4.4.4.4/32 3/NULL -/-
5.5.5.5/32 NULL/3 -/GE0/0/1
5.5.5.5/32 1024/3 -/GE0/0/1
6.6.6.6/32 NULL/1025 -/GE0/0/1
6.6.6.6/32 1025/1025 -/GE0/0/1
<P2>dis mpls lsp

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
4.4.4.4/32 NULL/3 -/GE0/0/1
4.4.4.4/32 1024/3 -/GE0/0/1
5.5.5.5/32 3/NULL -/-
6.6.6.6/32 NULL/3 -/GE0/0/0
6.6.6.6/32 1025/3 -/GE0/0/0
⑨ 去往192.168.2.1的數據包在ASBR1上G0/0/1封裝如圖所示;
BGP/MPLS *** Option B 跨域研究實驗
⑩ 在P2上查看標籤路徑:
<P2>dis fib 6.6.6.6
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
6.6.6.6/32 56.56.56.6 DGHU t[1633] GE0/0/0 0x3
<P2>dis mpls lsp

             LSP Information: LDP LSP

FEC In/Out Label In/Out IF Vrf Name
4.4.4.4/32 NULL/3 -/GE0/0/1
4.4.4.4/32 1024/3 -/GE0/0/1
5.5.5.5/32 3/NULL -/-
6.6.6.6/32 NULL/3 -/GE0/0/0
6.6.6.6/32 1025/3 -/GE0/0/0
把公網標籤1025換爲3
發現一個3這個特殊標籤,在離開P2時發生第二跳標籤彈出,把3的標籤也彈出;
在P2離開接口G0/0/1上抓包發現只留私網標籤1026:
BGP/MPLS *** Option B 跨域研究實驗
11、去往192.168.2.1數據包進入PE2:
<PE2>dis bgp ***v4 all routing-table label

BGP Local router ID is 6.6.6.6
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete

Total number of routes from all PE: 5

Route Distinguisher: 100:1

    Network           NextHop           In/Out Label

>i 34.34.34.0 4.4.4.4 NULL/1027
>i 192.168.1.0 4.4.4.4 NULL/1028
*> 192.168.2.0 192.168.2.254 1026/NULL
通過1026的標籤發現哪個***實例(MP-BGP分發的是私網標籤,用於在PE上指導私網數據從BGP ***V4的標籤表剝離標籤後轉移至對應的vrf);
12、去往192.168.2.1報文進入spi VRF路由表:
<PE2>dis ip routing-table ***-instance spi verbose

Destination: 192.168.2.0/24
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 192.168.2.254 Neighbour: 0.0.0.0
State: Active Adv Age: 05h28m11s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/1
TunnelID: 0x0 Flags: D
13、通過路由表到PC3主機:
Ping的截圖:
BGP/MPLS *** Option B 跨域研究實驗

BGP/MPLS *** Option B 跨域研究實驗

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