使用ENSP做MPLS偽線測試

chenjijun1139發表於2020-12-16

最近一個公司一個專案在運營商進行偽線功能測試,由於是菜鳥所以都是在旁邊看別人配置,公司也沒多餘的裝置供來實驗,自己就網上找了些資料實現了這個功能。
現場是2個A裝置對接2臺B裝置的環境,我做的實驗是直接拿了4臺Router來做,現場環境都是通過子介面連線要doltq,我直接通過埠連線就不需要了。
路由方式是OSPF的點對點,然後新增BFD檢測,不設定點對點切換很慢,
在這裡插入圖片描述

R3配置
sysname r3

bfd

mpls lsr-id 3.3.3.3
mpls

mpls l2vpn

mpls ldp

mpls ldp remote-peer 4.4.4.4

mpls ldp remote-peer 5.5.5.5

interface Ethernet0/0/0
mpls l2vc 4.4.4.4 100 control-word
mpls l2vpn pw bfd
mpls l2vc 5.5.5.5 200 control-word secondary
mpls l2vpn pw bfd secondary
mpls l2vpn stream-dual-receiving

interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.2.1 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface LoopBack0
ip address 3.3.3.3 255.255.255.255

ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 192.168.1.0 0.0.0.3
network 192.168.2.0 0.0.0.3

R4配置
sysname r4

bfd

mpls lsr-id 4.4.4.4
mpls

mpls l2vpn

mpls switch-l2vc 6.6.6.6 100 between 3.3.3.3 100 encapsulation ethernet control-
word-transparent
mpls switch-l2vc 6.6.6.6 200 between 3.3.3.3 200 encapsulation ethernet cont
rol-word-transparent

mpls ldp

mpls ldp remote-peer 3.3.3.3

mpls ldp remote-peer 6.6.6.6

interface GigabitEthernet0/0/0
ip address 192.168.1.2 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.3.1 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface LoopBack0
ip address 4.4.4.4 255.255.255.255

ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 192.168.1.0 0.0.0.3
network 192.168.3.0 0.0.0.3

R5配置

sysname r5

bfd

mpls lsr-id 5.5.5.5
mpls

mpls l2vpn

mpls switch-l2vc 6.6.6.6 100 between 3.3.3.3 100 encapsulation ethernet control-
word-transparent
mpls switch-l2vc 6.6.6.6 200 between 3.3.3.3 200 encapsulation ethernet control-
word-transparent

mpls ldp

mpls ldp remote-peer 3.3.3.3

mpls ldp remote-peer 6.6.6.6

interface GigabitEthernet0/0/0
ip address 192.168.2.2 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.4.1 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface LoopBack0
ip address 5.5.5.5 255.255.255.255

ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 5.5.5.5 0.0.0.0
network 192.168.2.0 0.0.0.3
network 192.168.4.0 0.0.0.3

R6配置

sysname r6

bfd

mpls lsr-id 6.6.6.6
mpls

mpls l2vpn

mpls ldp

mpls ldp remote-peer 4.4.4.4

mpls ldp remote-peer 5.5.5.5

interface Ethernet0/0/0
mpls l2vc 4.4.4.4 100 control-word
mpls l2vpn pw bfd
mpls l2vc 5.5.5.5 200 control-word secondary
mpls l2vpn pw bfd secondary
mpls l2vpn stream-dual-receiving

interface GigabitEthernet0/0/0
ip address 192.168.3.2 255.255.255.252
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.4.2 255.255.255.252
ospf cost 100
ospf network-type p2p
ospf bfd enable
mpls
mpls ldp

interface LoopBack0
ip address 6.6.6.6 255.255.255.255

ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 6.6.6.6 0.0.0.0
network 192.168.3.0 0.0.0.3
network 192.168.4.0 0.0.0.3

實現兩臺電腦PING通
在這裡插入圖片描述
OSPF狀態
在這裡插入圖片描述
BFD狀態
在這裡插入圖片描述
VC狀態
在這裡插入圖片描述
在這裡插入圖片描述
也不知道是不是做的準確的,只知道是通過,通過shutdown埠也可以實現鏈路的快速切換。

相關文章