如图所示,CE1和CE2(均划分VLAN 10 20) 所连接的VPN1网络的两个站点,位于172.1.1.0/24网络中,CE3和CE4(均划分VLAN 30 40) 所连接的VPN2网络的两个站点,位于172.1.2.0/24网路中
要求通过SVC方式VLL两个VPN 网络的各自两个站点间相同的VLAN中的用户通过MPLS/IP骨干网络实现二层互通。
思路分析:
根据实现要求,采用灵活的QinQ+VLANIF 接口方案来进行配置,为实现二层的直接访问,采用VLL,并手工指定VC标签即SVC方式。
1、配置各个节点设备上的vlan并配置vlanif接口;
2、在PE上配置灵活QinQ对用户vlan加装一层公网vlan标签;
3、在骨干网上配置ospf 协议,配置mpls 和ldp使用LDP LSP;
4、在PE上使用MPSL L2VPN 并手工配置vc 标签。
配置代码如下:
【PE1】
#
sysname PE1
#
vlan batch 100 200 800
#
mpls lsr-id 1.1.1.1
mpls
#
mpls l2vpn
#
mpls ldp
#
interface Vlanif100
mpls static-l2vc destination 3.3.3.3 transmit-vpn-label 100 receive-vpn-label 2
00 //静态配置vlanif VC标签
#
interface Vlanif200
mpls static-l2vc destination 3.3.3.3 transmit-vpn-label 700 receive-vpn-label 8
00 //静态配置vlanif VC标签
#
interface Vlanif800
ip address 10.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 800
#
interface GigabitEthernet0/0/2
qinq vlan-translation enable //使端口具有QinQ 的vlan转换功能
port hybrid tagged vlan 10 20 //允许用户标签通过
port hybrid untagged vlan 100 //允许公网标签通过
port vlan-stacking vlan 1 to 20 stack-vlan 100 //配置灵活QinQ对用户的vlan标签加装一层公网标签
#
interface GigabitEthernet0/0/3
qinq vlan-translation enable
port hybrid tagged vlan 30 40
port hybrid untagged vlan 200
port vlan-stacking vlan 30 to 40 stack-vlan 200
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 1.1.1.1 0.0.0.0
【P】
#
sysname P
#
vlan batch 100 200 800 900
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface Vlanif800
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlanif900
ip address 12.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 800
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 900
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
network 2.2.2.2 0.0.0.0
【PE2】
#
sysname PE2
#
vlan batch 100 200 900
#
mpls lsr-id 3.3.3.3
mpls
#
mpls l2vpn
#
mpls ldp
#
interface Vlanif100
mpls static-l2vc destination 1.1.1.1 transmit-vpn-label 200 receive-vpn-label 1
00
#
interface Vlanif200
mpls static-l2vc destination 1.1.1.1 transmit-vpn-label 800 receive-vpn-label 7
00
#
interface Vlanif900
ip address 12.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 900
#
interface GigabitEthernet0/0/2
qinq vlan-translation enable
port hybrid tagged vlan 10 20
port hybrid untagged vlan 100
port vlan-stacking vlan 1 to 20 stack-vlan 100
#
interface GigabitEthernet0/0/3
qinq vlan-translation enable
port hybrid tagged vlan 30 40
port hybrid untagged vlan 200
port vlan-stacking vlan 30 to 40 stack-vlan 200
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 12.1.1.0 0.0.0.255
network 3.3.3.3 0.0.0.0
【CE1】
#
sysname CE1
#
vlan batch 10 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
【CE2】
#
sysname CE2
#
vlan batch 10 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
【CE3】
#
sysname CE3
#
vlan batch 30 40
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 30 40
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 40
【CE4】
#
sysname CE4
#
vlan batch 30 40
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 30 40
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 40
验证测试
<PE1>dis mpls static-l2vc
Total svc connections: 2, 2 up, 0 down
*Client Interface : Vlanif100 is up
AC Status : up
VC State : up
VC ID : 0
VC Type : VLAN
Destination : 3.3.3.3
Transmit VC Label : 100
Receive VC Label : 200
Label Status : 0
Token Status : 0
Control Word : Disable
………………………………
*Client Interface : Vlanif200 is up
AC Status : up
VC State : up
VC ID : 0
VC Type : VLAN
Destination : 3.3.3.3
Transmit VC Label : 700
Receive VC Label : 800
Label Status : 0
Token Status : 0
Control Word : Disable
…………………………………………
<PE1>display l2vpn ccc-interface vc-type static-vc up
Total ccc-interface of SVC VC: 2
up (2), down (0)
Interface Encap Type State VC Type
Vlanif100 vlan up static-vc
Vlanif200 vlan up static-vc
可以看到VC连接的状态均为UP,同时CE两端相同vlan中的用户都是可以相互Ping通的。