配置QinQ终结子接口接入VLL示例
配置思路
采用如下的思路配置QinQ子接口接入VLL:
在骨干网相关设备(PE、P)上配置IGP路由协议实现互通,并使能MPLS。
本例使用缺省隧道策略,建立LSP作为传输业务数据的隧道。
PE上使能MPLS L2VPN,并创建VC连接。
在PE连接CE的接口上配置QinQ子接口接入VLL。
操作步骤
- 按图8-10配置CE、PE和P的各接口的IP地址
# 以CE1为例。其他设备的配置和CE1类似,详见配置文件。
<Huawei> system-view [Huawei] sysname CE1 [CE1] interface gigabitethernet 1/0/0.1 [CE1-GigabitEthernet1/0/0.1] ip address 10.100.1.1 255.255.255.0 [CE1-GigabitEthernet1/0/0.1] quit
- 配置CE发送给PE的报文带有两层VLAN Tag
# 这里假设内层VLAN ID为10,外层VLAN ID为100。
# 配置CE1。
[CE1] interface gigabitethernet 1/0/0.1 [CE1-GigabitEthernet1/0/0.1] qinq termination pe-vid 100 ce-vid 10 [CE1-GigabitEthernet1/0/0.1] quit
# 配置CE2。
[CE2] interface gigabitethernet 1/0/0.1 [CE2-GigabitEthernet1/0/0.1] qinq termination pe-vid 100 ce-vid 10 [CE2-GigabitEthernet1/0/0.1] quit
- 在MPLS骨干网上配置IGP,本示例中使用OSPF
# 配置OSPF时,注意需要发布PE1、P和PE2作为LSR ID的32位Loopback接口地址。
# 以PE1为例。其他设备的配置和PE1类似,详见配置文件。
[PE1] ospf 1 [PE1-ospf-1] area 0 [PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [PE1-ospf-1-area-0.0.0.0] network 10.10.1.9 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
- 在MPLS骨干网上配置MPLS基本能力和LDP
# 配置PE1。
[PE1] mpls lsr-id 10.10.1.9 [PE1] mpls [PE1-mpls] quit [PE1] mpls ldp [PE1-mpls-ldp] quit [PE1] interface gigabitethernet 2/0/0 [PE1-GigabitEthernet2/0/0] mpls [PE1-GigabitEthernet2/0/0] mpls ldp [PE1-GigabitEthernet2/0/0] quit
# 配置P。
[P] mpls lsr-id 10.20.2.9 [P] mpls [P-mpls] quit [P] mpls ldp [P-mpls-ldp] quit [P] interface gigabitethernet 2/0/0 [P-GigabitEthernet2/0/0] mpls [P-GigabitEthernet2/0/0] mpls ldp [P-GigabitEthernet2/0/0] quit [P] interface gigabitethernet 1/0/0 [P-GigabitEthernet1/0/0] mpls [P-GigabitEthernet1/0/0] mpls ldp [P-GigabitEthernet1/0/0] quit
# 配置PE2。
[PE2] mpls lsr-id 10.30.3.9 [PE2] mpls [PE2-mpls] quit [PE2] mpls ldp [PE2-mpls-ldp] quit [PE2] interface gigabitethernet 1/0/0 [PE2-GigabitEthernet1/0/0] mpls [PE2-GigabitEthernet1/0/0] mpls ldp [PE2-GigabitEthernet1/0/0] quit
- 在PE之间建立远端LDP会话
# 配置PE1。
[PE1] mpls ldp remote-peer 10.30.3.9 [PE1-mpls-ldp-remote-10.30.3.9] remote-ip 10.30.3.9 [PE1-mpls-ldp-remote-10.30.3.9] quit
# 配置PE2。
[PE2] mpls ldp remote-peer 10.10.1.9 [PE2-mpls-ldp-remote-10.10.1.9] remote-ip 10.10.1.9 [PE2-mpls-ldp-remote-10.10.1.9] quit
# 上述配置完成后,在PE1上执行display mpls ldp session命令查看LDP会话的建立情况,可以看到增加了与PE2的远端LDP会话。
[PE1] display 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 ------------------------------------------------------------------------------ 10.20.2.9:0 Operational DU Passive 0000:00:11 46/45 10.30.3.9:0 Operational DU Passive 0000:00:01 8/8 ------------------------------------------------------------------------------ TOTAL: 2 session(s) Found.
- 在PE上使能MPLS L2VPN,并创建VC连接
# 配置PE1:在接入CE1的接口GE1/0/0.1上创建VC。
[PE1] mpls l2vpn [PE1-l2vpn] quit [PE1] interface gigabitethernet 1/0/0.1 [PE1-GigabitEthernet1/0/0.1] qinq termination pe-vid 100 ce-vid 10 [PE1-GigabitEthernet1/0/0.1] mpls l2vc 10.30.3.9 101 [PE1-GigabitEthernet1/0/0.1] quit
# 配置PE2:在接入CE2的接口GE2/0/0.1上创建VC。
[PE2] mpls l2vpn [PE2-l2vpn] quit [PE2] interface gigabitethernet 2/0/0.1 [PE2-GigabitEthernet2/0/0.1] qinq termination pe-vid 100 ce-vid 10 [PE2-GigabitEthernet2/0/0.1] mpls l2vc 10.10.1.9 101 [PE2-GigabitEthernet2/0/0.1] quit
- 验证配置结果
# 在PE上查看L2VPN连接信息,可以看到建立了一条L2 VC,状态为UP。
[PE1] display mpls l2vc interface gigabitethernet 1/0/0.1 *client interface : GigabitEthernet1/0/0.1 is up Administrator PW : no session state : up AC status : up Ignore AC state : disable VC state : up Label state : 0 Token state : 0 VC ID : 101 VC type : VLAN destination : 10.30.3.9 local group ID : 0 remote group ID : 0 local VC label : 1024 remote VC label : 1024 local AC OAM State : up local PSN OAM State : up local forwarding state : forwarding local status code : 0x0 remote AC OAM state : up remote PSN OAM state : up remote forwarding state: forwarding remote status code : 0x0 ignore standby state : no BFD for PW : unavailable VCCV State : up manual fault : not set active state : active forwarding entry : exist link state : up local VC MTU : 1500 remote VC MTU : 1500 local VCCV : alert ttl lsp-ping bfd remote VCCV : alert ttl lsp-ping bfd local control word : disable remote control word : disable tunnel policy name : -- PW template name : -- primary or secondary : primary load balance type : flow Access-port : false Switchover Flag : false VC tunnel/token info : 1 tunnels/tokens NO.0 TNL type : lsp , TNL ID : 0x5 Backup TNL type : lsp , TNL ID : 0x0 create time : 0 days, 0 hours, 27 minutes, 15 seconds up time : 0 days, 0 hours, 2 minutes, 22 seconds last change time : 0 days, 0 hours, 2 minutes, 22 seconds VC last up time : 2011/09/26 15:29:03 VC total up time : 0 days, 0 hours, 2 minutes, 22 seconds CKey : 5 NKey : 4 PW redundancy mode : frr AdminPw interface : -- AdminPw link state : -- Diffserv Mode : uniform Service Class : -- Color : -- DomainId : -- Domain Name : --
CE1和CE2能够相互Ping通。
以CE1的显示为例:
[CE1] ping 10.100.1.2 PING 10.100.1.2: 56 data bytes, press CTRL_C to break Reply from 10.100.1.2: bytes=56 Sequence=1 ttl=255 time=31 ms Reply from 10.100.1.2: bytes=56 Sequence=2 ttl=255 time=10 ms Reply from 10.100.1.2: bytes=56 Sequence=3 ttl=255 time=5 ms Reply from 10.100.1.2: bytes=56 Sequence=4 ttl=255 time=2 ms Reply from 10.100.1.2: bytes=56 Sequence=5 ttl=255 time=28 ms --- 10.100.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/15/31 ms
配置文件
CE1的配置文件
# sysname CE1 # interface GigabitEthernet1/0/0 # interface GigabitEthernet1/0/0.1 qinq termination pe-vid 100 ce-vid 10 ip address 10.100.1.1 255.255.255.0 # return
PE1的配置文件
# sysname PE1 # mpls lsr-id 10.10.1.9 mpls # mpls l2vpn # mpls ldp # mpls ldp remote-peer 10.30.3.9 remote-ip 10.30.3.9 # interface GigabitEthernet1/0/0 # interface GigabitEthernet1/0/0.1 qinq termination pe-vid 100 ce-vid 10 mpls l2vc 10.30.3.9 101 # interface GigabitEthernet2/0/0 ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 10.10.1.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.9 0.0.0.0 network 10.1.1.0 0.0.0.255 # return
P的配置文件
# sysname P # mpls lsr-id 10.20.2.9 mpls # mpls ldp # interface GigabitEthernet2/0/0 ip address 10.1.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet1/0/0 ip address 10.2.2.2 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 10.20.2.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.20.2.9 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.2.2.0 0.0.0.255 # return
PE2的配置文件
# sysname PE2 # mpls lsr-id 10.30.3.9 mpls # mpls l2vpn # mpls ldp # mpls ldp remote-peer 10.10.1.9 remote-ip 10.10.1.9 # interface GigabitEthernet1/0/0 ip address 10.2.2.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 # interface GigabitEthernet2/0/0.1 qinq termination pe-vid 100 ce-vid 10 mpls l2vc 10.10.1.9 101 # interface LoopBack1 ip address 10.30.3.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.30.3.9 0.0.0.0 network 10.2.2.0 0.0.0.255 # return
CE2的配置文件
# sysname CE2 # interface GigabitEthernet1/0/0 # interface GigabitEthernet1/0/0.1 qinq termination pe-vid 100 ce-vid 10 ip address 10.100.1.2 255.255.255.0 # return