1、实验环境
以华为模拟器eNSP为实验环境,结合wireshark抓包进行BGP/MPLS ××× OptionA 控制层面、数据层面以及日常排错三个方面进行研究;如下图所示:
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
查看公网路有:
dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
Route Flags: R - relay, D - download to fib
Public routing table : OSPF
Destinations : 3 Routes : 3
OSPF routing table status :
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 :
Destinations : 0 Routes : 0
查看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:
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
查看公网路有:
dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
Route Flags: R - relay, D - download to fib
Public routing table : OSPF
Destinations : 3 Routes : 3
OSPF routing table status :
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 :
Destinations : 0 Routes : 0
查看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:
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站点×××私网路由:
①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情况:
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
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情况:
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 A跨域配置:
①ISP1
ASBR1:
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/0.10
dot1q termination vid 10
ip binding ***-instance spi
ip address 34.34.34.3 255.255.255.0
arp broadcast enable
interface GigabitEthernet0/0/0.20
dot1q termination vid 20
ip binding ***-instance spd
ip address 34.34.34.33 255.255.255.0
arp broadcast enable
Ping 测对端接口地址:
PING 34.34.34.4: 56 data bytes, press CTRL_C to break
Reply from 34.34.34.4: bytes=56 Sequence=1 ttl=255 time=130 ms
Reply from 34.34.34.4: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 34.34.34.4: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 34.34.34.4: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 34.34.34.4: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 34.34.34.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/46/130 ms
PING 34.34.34.44: 56 data bytes, press CTRL_C to break
Reply from 34.34.34.44: bytes=56 Sequence=1 ttl=255 time=140 ms
Reply from 34.34.34.44: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 34.34.34.44: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 34.34.34.44: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 34.34.34.44: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 34.34.34.44 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/48/140 ms
ASBR1与ASBR2的××× spi 通过OSPF路由交互:
ospf 11 ***-instance spi
area 0.0.0.0
network 34.34.34.3 0.0.0.0
dis ospf peer brief
OSPF Process 11 with Router ID 34.34.34.3
Peer Statistic Information
OSPF Process 11 with Router ID 34.34.34.3
Peer Statistic Information
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0.10 34.34.34.4 Full
路由互相导入与路由策略:
[ASBR1] ospf 11 ***-instance spi
import-route bgp
[ASBR2] ospf 11 ***-instance spi
dn-bit-check disable ase(否则不加入ASBR2的××× spi路由表)
[ASBR1]ospf 11 ***-instance spi
[ASBR1-ospf-11]dn-bit-check disable ase
[ASBR1]bgp 100
[ASBR1-bgp]ipv4-family ***-instance spi
[ASBR1-bgp-spi]import-route ospf 11
ASBR1与ASBR2的××× spd 通过BGP路由交互:
Bgp100
ipv4-family ***-instance spd
peer 34.34.34.44 as-number 200
BGP local router ID : 3.3.3.3
Local AS number : 100
Total number of peers : 2 Peers in established state : 2
Peer of IPv4-family for *** instance :
×××-Instance spd, Router ID 3.3.3.3:
34.34.34.44 4 200 5 6 0 00:02:50 Established 1
由于ASBR1与ASBR2之间*** spd 直接用BGP交换路由无需导入路由
dis ip routing-table ***-instance spd
Route Flags: R - relay, D - download to fib
Route Flags: R - relay, D - download to fib
Routing Tables: spd
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.1.0/24 IBGP 255 0 RD 1.1.1.1 GigabitEthernet
0/0/1
10.10.2.0/24 EBGP 255 0 D 34.34.34.44 GigabitEthernet
0/0/0.20
34.34.34.0/24 Direct 0 0 D 34.34.34.33 GigabitEthernet
0/0/0.20
34.34.34.33/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.20
34.34.34.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.20
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
②ISP2
ASBR2:
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/0.10
dot1q termination vid 10
ip binding ***-instance spi
ip address 34.34.34.4 255.255.255.0
arp broadcast enable
interface GigabitEthernet0/0/0.20
dot1q termination vid 20
ip binding ***-instance spd
ip address 34.34.34.44 255.255.255.0
arp broadcast enable
ASBR2与ASBR1的××× spi 通过OSPF路由交互:
ospf 11 ***-instance spi
area 0.0.0.0
network 34.34.34.4 0.0.0.0
路由互相导入与路由策略:
[ASBR2]bgp200
[ASBR2-bgp]ipv4-family ***-instance spi
[ASBR2-bgp-spi]import-route ospf 11
[ASBR2]ospf 11 ***-instance spi
[ASBR2-ospf-11]import-route bgp
ASBR2与ASBR1的××× spd 通过BGP路由交互:
Bgp200
ipv4-family ***-instance spd
peer 34.34.34.33 as-number 100
由于ASBR2与ASBR1之间*** spd 直接用BGP交换路由无需导入路由
dis ip routing-table ***-instance spd
Route Flags: R - relay, D - download to fib
Route Flags: R - relay, D - download to fib
Routing Tables: spd
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.1.0/24 EBGP 255 0 D 34.34.34.33 GigabitEthernet
0/0/0.20
10.10.2.0/24 IBGP 255 0 RD 6.6.6.6 GigabitEthernet
0/0/1
34.34.34.0/24 Direct 0 0 D 34.34.34.44 GigabitEthernet
0/0/0.20
34.34.34.44/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.20
34.34.34.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.20
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
3、控制层面分析
1)CE3的路由192.168.2.0/24传递给CE1过程:
①PE2上连接CE3直连路由:
dis ip routing-table ***-instance spi protocol direct
Route Flags: R - relay, D - download to fib
Route Flags: R - relay, D - download to fib
spi routing table : Direct
Destinations : 4 Routes : 4
Direct routing table status :
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 :
Destinations : 0 Routes : 0
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中:
[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路由情况:
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
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
④ASBR2 在MP-BGP中收到192.168.2.0/24路由情况:
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: 5
Route Distinguisher: 100:1
Network NextHop In/Out Label
*>i 192.168.2.0 6.6.6.6 NULL/1026
dis ip routing-table ***-instance spi verbose
Destination: 192.168.2.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 6.6.6.6 Neighbour: 6.6.6.6
State: Active Adv Relied Age: 02h05m23s
Tag: 0 Priority: low
Label: 1026 QoSInfo: 0x0
IndirectID: 0x4
RelayNextHop: 45.45.45.5 Interface: GigabitEthernet0/0/1
TunnelID: 0x3 Flags: RD
⑤ASBR2 把MP-BGP中收到192.168.2.0/24路由加入××× spi路由表情况:
dis ip routing-table ***-instance spi
Route Flags: R - relay, D - download to fib
Destination: 192.168.2.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 6.6.6.6 Neighbour: 6.6.6.6
State: Active Adv Relied Age: 02h05m23s
Tag: 0 Priority: low
Label: 1026 QoSInfo: 0x0
IndirectID: 0x4
RelayNextHop: 45.45.45.5 Interface: GigabitEthernet0/0/1
TunnelID: 0x3 Flags: RD
⑤ASBR2 把MP-BGP中收到192.168.2.0/24路由加入××× spi路由表情况:
Route Flags: R - relay, D - download to fib
Routing Tables: spi
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
34.34.34.0/24 Direct 0 0 D 34.34.34.4 GigabitEthernet
0/0/0.10
34.34.34.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.10
34.34.34.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.10
192.168.1.0/24 O_ASE 150 1 D 34.34.34.3 GigabitEthernet
0/0/0.10
192.168.2.0/24 IBGP 255 0 RD 6.6.6.6 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
⑥ ASBR2与ASBR1 ××× spi 之间交互通过OSPF ***实例进行,所以报IBGP中路由导入OSPF11中:
ospf 11 ***-instance spi
import-route bgp
⑦ 在ASBR1上进行查收192.168.2.0/24路由情况:
Destination: 192.168.2.0/24
Protocol: O_ASE Process ID: 11
Preference: 150 Cost: 1
NextHop: 34.34.34.4 Neighbour: 0.0.0.0
State: Active Adv Age: 01h16m27s
Tag: 3489661128 Priority: low
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/0.10
TunnelID: 0x0 Flags: D
dis ip routing-table ***-instance spi
Route Flags: R - relay, D - download to fib
Route Flags: R - relay, D - download to fib
Routing Tables: spi
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
34.34.34.0/24 Direct 0 0 D 34.34.34.3 GigabitEthernet
0/0/0.10
34.34.34.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.10
34.34.34.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.10
192.168.1.0/24 IBGP 255 0 RD 1.1.1.1 GigabitEthernet
0/0/1
192.168.2.0/24 O_ASE 150 1 D 34.34.34.4 GigabitEthernet
0/0/0.10
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
⑧ 在ASBR1把192.168.2.0/24路由导入MP-BGP中:
[V200R003C00]
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
ipv4-family ***-instance spi
import-route ospf 11
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: 5
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.2.0 34.34.34.4 1028/NULL
⑨ 在PE1上收到192.168.2.0/24路由情况:
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: 5
Route Distinguisher: 100:1
Network NextHop In/Out Label
>i 192.168.2.0 3.3.3.3 NULL/1028
Destination: 192.168.2.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 2
NextHop: 3.3.3.3 Neighbour: 3.3.3.3
State: Active Adv Relied Age: 01h24m15s
Tag: 0 Priority: low
Label: 1028 QoSInfo: 0x0
IndirectID: 0x4
RelayNextHop: 12.12.12.2 Interface: GigabitEthernet0/0/0
TunnelID: 0x3 Flags: RD
、
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;
③ 路由迭代,查找到路由如下:
dis ip routing-table 3.3.3.3
Route Flags: R - relay, D - download to fib
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
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:
dis mpls lsp
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:
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
④ 去往192.168.2.1的数据包在PE1上G0/0/0封装如图所示;
PE1的G0/0/0上使能了MPLS,所以进行MPLS2.5层标签转发;
⑤ 在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
dis mpls lsp
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
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上抓包发现只留私网标签1028:
⑥ 在ASBR1上BGP路由中发现标签为:
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: 5
Route Distinguisher: 100:1
Network NextHop In/Out Label
> 192.168.2.0 34.34.34.4 1028/NULL
通过1028的标签发现哪个×××实例(MP-BGP分发的是私网标签,用于在PE上指导私网数据从BGP ×××V4的标签表剥离标签后转移至对应的vrf);
⑦去往192.168.2.1报文进入spi VRF路由表:
dis ip routing-table ***-instance spi verbose
Destination: 192.168.2.0/24
Protocol: O_ASE Process ID: 11
Preference: 150 Cost: 1
NextHop: 34.34.34.4 Neighbour: 0.0.0.0
State: Active Adv Age: 02h38m50s
Tag: 3489661128 Priority: low
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/0.10
TunnelID: 0x0 Flags: D
dis fib ***-instance spi 192.168.2.0
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
192.168.2.0/24 34.34.34.4 DGU t[13389] GE0/0/0.10 0x0
无隧道标志正常发出,在ASBR1的G0/0/0上抓包如图:
⑧去往192.168.2.1报文进入ASBR2:
dis fib ***-instance spi 192.168.2.0
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
192.168.2.0/24 45.45.45.5 DGU t[9481] GE0/0/1 0x3
dis ip routing-table ***-instance spi verbose
Destination: 192.168.2.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 6.6.6.6 Neighbour: 6.6.6.6
State: Active Adv Relied Age: 03h44m14s
Tag: 0 Priority: low
Label: 1026 QoSInfo: 0x0
IndirectID: 0x4
RelayNextHop: 45.45.45.5 Interface: GigabitEthernet0/0/1
TunnelID: 0x3 Flags: RD
下一跳为6.6.6.6,路由迭代:
dis fib 6.6.6.6
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
6.6.6.6/32 45.45.45.5 DGHU t[1639] GE0/0/1 0x3
dis mpls lsp
Destination: 192.168.2.0/24
Protocol: O_ASE Process ID: 11
Preference: 150 Cost: 1
NextHop: 34.34.34.4 Neighbour: 0.0.0.0
State: Active Adv Age: 02h38m50s
Tag: 3489661128 Priority: low
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/0.10
TunnelID: 0x0 Flags: D
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
192.168.2.0/24 34.34.34.4 DGU t[13389] GE0/0/0.10 0x0
无隧道标志正常发出,在ASBR1的G0/0/0上抓包如图:
⑧去往192.168.2.1报文进入ASBR2:
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
192.168.2.0/24 45.45.45.5 DGU t[9481] GE0/0/1 0x3
Destination: 192.168.2.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 6.6.6.6 Neighbour: 6.6.6.6
State: Active Adv Relied Age: 03h44m14s
Tag: 0 Priority: low
Label: 1026 QoSInfo: 0x0
IndirectID: 0x4
RelayNextHop: 45.45.45.5 Interface: GigabitEthernet0/0/1
TunnelID: 0x3 Flags: RD
下一跳为6.6.6.6,路由迭代:
Route Entry Count: 1
Destination/Mask Nexthop Flag TimeStamp Interface TunnelID
6.6.6.6/32 45.45.45.5 DGHU t[1639] GE0/0/1 0x3
LSP Information: BGP LSP
FEC In/Out Label In/Out IF Vrf Name
10.10.1.0/24 1026/NULL -/- spd
34.34.34.0/24 1027/NULL -/- spi
192.168.1.0/24 1028/NULL -/- spi
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
⑨ 去往192.168.2.1的数据包在PE2上G0/0/0封装如图所示;
⑩ 在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
dis mpls lsp
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
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:
11、去往192.168.2.1数据包进入PE2:
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路由表:
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的截图: