配置VPLS over SR-MPLS TE示例(LDP方式)
采用LDP方式的VPLS迭代的公网隧道可以是SR-MPLS TE隧道。
组网需求
本示例中interface1,inerface2,subinterface1.1,subinterface2.1分别代表GE0/1/1,GE0/1/2,GE0/1/1.1,GE0/1/2.1。
如图2-13,CE1和CE2属于同一VPLS,分别通过PE1和PE2接入MPLS骨干网。MPLS骨干网使用OSPF作为IGP协议。
要求配置LDP方式的VPLS,PE1和PE2之间建立SR-MPLS TE隧道来承载此VPLS业务。
配置思路
采用如下的思路配置L2VPN迭代SR-MPLS TE:
在骨干网相关设备(PE、P)上配置路由协议实现互通,并使能MPLS。
建立SR-MPLS TE隧道,并配置隧道策略。建立SR-MPLS TE隧道的具体操作请参见《NE20E配置指南-Segment Routing》。
PE上使能MPLS L2VPN。
在PE上创建VSI,指定信令为LDP,然后将VSI与AC接口绑定。
配置VSI使用SR-MPLS TE隧道。
操作步骤
- 配置骨干网各接口的IP地址并配置OSPF协议
具体配置过程略。
- 使能MPLS、MPLS TE
在隧道沿途各节点的系统视图及接口视图下使能MPLS和MPLS TE,并在隧道入节点的系统视图下使能MPLS TE。
# 配置PE1。
[~PE1] mpls lsr-id 1.1.1.9
[*PE1] mpls
[*PE1-mpls] mpls te
[*PE1-mpls] quit
[*PE1] commit
# 配置P。
[~P] mpls lsr-id 2.2.2.9
[*P] mpls
[*P-mpls] mpls te
[*P-mpls] quit
[*P] commit
# 配置PE2。
[~PE2] mpls lsr-id 3.3.3.9
[*PE2] mpls
[*PE2-mpls] mpls te
[*PE2-mpls] quit
[*PE2] commit
- 在骨干网上配置OSPF TE
# PE1的配置。
[~PE1] ospf 1
[*PE1-ospf-1] opaque-capability enable
[*PE1-ospf-1] area 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[*PE1-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*PE1-ospf-1-area-0.0.0.0] mpls-te enable
[*PE1-ospf-1-area-0.0.0.0] quit
[*PE1-ospf-1] quit
[*PE1] commit
# P的配置。
[~P] ospf 1
[*P-ospf-1] opaque-capability enable
[*P-ospf-1] area 0.0.0.0
[*P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[*P-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] network 10.20.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] mpls-te enable
[*P-ospf-1-area-0.0.0.0] quit
[*P-ospf-1] quit
[*P] commit
# PE2的配置。
[~PE2] ospf 1
[*PE2-ospf-1] opaque-capability enable
[*PE2-ospf-1] area 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[*PE2-ospf-1-area-0.0.0.0] network 10.20.1.0 0.0.0.255
[*PE2-ospf-1-area-0.0.0.0] mpls-te enable
[*PE2-ospf-1-area-0.0.0.0] quit
[*PE2-ospf-1] quit
[*PE2] commit
- 在骨干网上配置Segment Routing
# 配置PE1
[~PE1] segment-routing
[*PE1-segment-routing] quit
[*PE1] ospf 1
[*PE1-ospf-1] segment-routing mpls
[*PE1-ospf-1] segment-routing global-block 16000 47999
[*PE1-ospf-1] quit
# 配置P
[~P] segment-routing
[*P1-segment-routing] quit
[*P] ospf 1
[*P-ospf-1] segment-routing mpls
[*P-ospf-1] segment-routing global-block 16000 47999
[*P-ospf-1] quit
# 配置PE2
[~PE2] segment-routing
[*PE2-segment-routing] quit
[*PE2] ospf 1
[*PE2-ospf-1] segment-routing mpls
[*PE2-ospf-1] segment-routing global-block 16000 47999
[*PE2-ospf-1] quit
- 配置显式路径
# 配置PE1
[~PE1] explicit-path path2pe2
[*PE1-explicit-path-path2pe2] next sid label 16300 type prefix
[*PE1-explicit-path-path2pe2] next sid label 16200 type prefix
[*PE1-explicit-path-path2pe2] quit
# 配置PE2
[~PE2] explicit-path path2pe1
[*PE2-explicit-path-path2pe1] next sid label 16300 type prefix
[*PE2-explicit-path-path2pe1] next sid label 16200 type prefix
[*PE2-explicit-path-path2pe1] quit
- 配置Tunnel接口
# 在PE上创建Tunnel接口,指定隧道协议为MPLS TE,信令协议为Segment Routing。
# 配置PE1
[~PE1] interface Tunnel 10
[*PE1-Tunnel10] ip address unnumbered interface loopback1
[*PE1-Tunnel10] tunnel-protocol mpls te
[*PE1-Tunnel10] destination 3.3.3.9
[*PE1-Tunnel10] mpls te signal-protocol segment-routing
[*PE1-Tunnel10] mpls te tunnel-id 100
[*PE1-Tunnel10] mpls te path explicit-path path2pe2
[*PE1-Tunnel10] quit
[*PE1] commit
# 配置PE2
[~PE2] interface Tunnel 10
[*PE2-Tunnel10] ip address unnumbered interface loopback1
[*PE2-Tunnel10] tunnel-protocol mpls te
[*PE2-Tunnel10] destination 1.1.1.9
[*PE2-Tunnel10] mpls te signal-protocol segment-routing
[*PE2-Tunnel10] mpls te tunnel-id 100
[*PE2-Tunnel10] mpls te path explicit-path path2pe1
[*PE2-Tunnel10] quit
[*PE2] commit
在系统视图下执行display tunnel-info all命令,可以看到PE之间存在目的地址为对方MPLS LSR ID的TE隧道。以PE1的显示为例。
[~PE1] display tunnel-info all
Tunnel ID Type Destination Status ----------------------------------------------------------------------------- 0x000000000300000001 sr-te 3.3.3.9 UP
- 配置LDP远端会话
在PE1和PE2之间建立远端对等体会话。
# 配置PE1。
[~PE1] mpls ldp
[*PE1-mpls-ldp] quit
[*PE1] mpls ldp remote-peer 3.3.3.9
[*PE1-mpls-ldp-remote-3.3.3.9] remote-ip 3.3.3.9
[*PE1-mpls-ldp-remote-3.3.3.9] quit
[*PE1] commit
# 配置PE2。
[~PE2] mpls ldp
[*PE2-mpls-ldp] quit
[*PE2] mpls ldp remote-peer 1.1.1.9
[*PE2-mpls-ldp-remote-1.1.1.9] remote-ip 1.1.1.9
[*PE2-mpls-ldp-remote-1.1.1.9] quit
[*PE2] commit
- 配置隧道策略
# 配置PE1。
[~PE1] tunnel-policy policy1
[*PE1-tunnel-policy-policy1] tunnel binding destination 3.3.3.9 te Tunnel10
[*PE1-tunnel-policy-policy1] quit
[*PE1] commit
# 配置PE2。
[~PE2] tunnel-policy policy1
[*PE2-tunnel-policy-policy1] tunnel binding destination 1.1.1.9 te Tunnel10
[*PE2-tunnel-policy-policy1] quit
[*PE2] commit
- 在PE上使能MPLS L2VPN
# 配置PE1。
[~PE1] mpls l2vpn
[*PE1] commit
# 配置PE2。
[~PE2] mpls l2vpn
[*PE2] commit
- 在PE上创建VSI,并配置隧道策略。
# 配置PE1。
[~PE1] vsi a2
[*PE1-vsi-a2] pwsignal ldp
[*PE1-vsi-a2-ldp] vsi-id 2
[*PE1-vsi-a2-ldp] peer 3.3.3.9 tnl-policy policy1
[*PE1-vsi-a2-ldp] quit
[*PE1] commit
# 配置PE2。
[~PE2] vsi a2
[*PE2-vsi-a2] pwsignal ldp
[*PE2-vsi-a2-ldp] vsi-id 2
[*PE2-vsi-a2-ldp] peer 1.1.1.9 tnl-policy policy1
[*PE2-vsi-a2-ldp] quit
[*PE2] commit
- 在PE上配置VSI与接口的绑定
# 配置PE1。
[~PE1] interface gigabitethernet0/2/0.1
[*PE1-GigabitEthernet0/2/0.1] vlan-type dot1q 10
[*PE1-GigabitEthernet0/2/0.1] l2 binding vsi a2
[*PE1-GigabitEthernet0/2/0.1] quit
[*PE1] commit
# 配置PE2。
[~PE2] interface gigabitethernet0/2/0.1
[*PE2-GigabitEthernet0/2/0.1] vlan-type dot1q 10
[*PE2-GigabitEthernet0/2/0.1] l2 binding vsi a2
[*PE2-GigabitEthernet0/2/0.1] quit
[*PE2] commit
# 配置CE1
[~CE1] interface gigabitethernet0/1/0.1
[*CE1-GigabitEthernet0/1/0.1] vlan-type dot1q 10
[*CE1-GigabitEthernet0/1/0.1] ip address 10.1.1.1 255.255.255.0
[*CE1-GigabitEthernet0/1/0.1] quit
[*CE1] commit
# 配置CE2
[~CE2] interface gigabitethernet0/1/0.1
[*CE2-GigabitEthernet0/1/0.1] vlan-type dot1q 10
[*CE2-GigabitEthernet0/1/0.1] ip address 10.1.1.2 255.255.255.0
[*CE2-GigabitEthernet0/1/0.1] quit
[*CE2] commit
- 检查配置结果
完成上述配置后,在PE1上执行display vsi name a2 verbose命令,可以看到名字为a2的VSI建立了一条PW到PE2,VSI状态为UP。
[~PE1] display vsi name a2 verbose
***VSI Name : a2 Administrator VSI : no Isolate Spoken : disable VSI Index : 1 PW Signaling : ldp Member Discovery Style : -- Bridge-domain Mode : disable PW MAC Learning Style : unqualify Encapsulation Type : vlan MTU : 1500 Diffserv Mode : uniform Service Class : -- Color : -- DomainId : 255 Domain Name : Ignore AcState : disable P2P VSI : disable Create Time : 1 days, 8 hours, 46 minutes, 34 seconds VSI State : up Resource Status : -- VSI ID : 2 *Peer Router ID : 3.3.3.9 primary or secondary : primary ignore-standby-state : no VC Label : 18 Peer Type : dynamic Session : up Tunnel ID : 0x000000000300000001 Broadcast Tunnel ID : -- Broad BackupTunnel ID : -- Tunnel Policy Name : policy1 CKey : 33 NKey : 1610612843 Stp Enable : 0 PwIndex : 0 Control Word : disable Interface Name : GigabitEthernet0/2/0.1 State : up Access Port : false Last Up Time : 2012/09/10 10:14:46 Total Up Time : 1 days, 8 hours, 41 minutes, 37 seconds **PW Information: *Peer Ip Address : 3.3.3.9 PW State : up Local VC Label : 18 Remote VC Label : 18 Remote Control Word : disable PW Type : label Tunnel ID : 0x000000000300000001 Broadcast Tunnel ID : -- Broad BackupTunnel ID : -- Ckey : 33 Nkey : 1610612843 Main PW Token : 0x0 Slave PW Token : 0x0 Tnl Type : te OutInterface : Tunnel10 Backup OutInterface : -- Stp Enable : 0 PW Last Up Time : 2012/09/11 09:19:12 PW Total Up Time : 1 days, 6 hours, 52 minutes, 3 seconds
在PE1上执行display vsi pw out-interface vsi a2命令,可以看到1.1.1.9与3.3.3.9之间建立的MPLS TE隧道的出接口为Tunnel10。
[~PE1] display vsi pw out-interface vsi a2
Total: 1 -------------------------------------------------------------------------------- Vsi Name peer vcid interface -------------------------------------------------------------------------------- a2 3.3.3.9 2 Tunnel10
CE1与CE2可以相互Ping通对方。
<CE1> ping 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=125 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=125 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=94 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=125 ms
Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=125 ms
--- 10.1.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 94/118/125 ms
配置文件
CE1的配置文件
# sysname CE1 # interface GigabitEthernet0/1/1 undo shutdown # interface GigabitEthernet0/1/1.1 undo shutdown vlan-type dot1q 10 ip address 10.1.1.1 255.255.255.0 # return
PE1的配置文件
# sysname PE1 # mpls lsr-id 1.1.1.9 # mpls mpls te # mpls l2vpn # vsi a2 pwsignal ldp vsi-id 2 peer 3.3.3.9 tnl-policy policy1 # explicit-path path2pe2 next sid label 16300 type prefix next sid label 16200 type prefix # mpls ldp # ipv4-family # mpls ldp remote-peer 3.3.3.9 remote-ip 3.3.3.9 # segment-routing # interface GigabitEthernet0/1/0 undo shutdown # interface GigabitEthernet0/1/0.1 undo shutdown vlan-type dot1q 10 l2 binding vsi a2 # interface GigabitEthernet0/1/1 undo shutdown ip address 10.10.1.1 255.255.255.0 ospf cost 1 # interface GigabitEthernet0/1/2 undo shutdown # interface GigabitEthernet0/1/2.1 undo shutdown vlan-type dot1q 10 l2 binding vsi a2 # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 ospf enable 1 area 0.0.0.0 ospf prefix-sid absolute 16100 # interface Tunnel10 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.9 mpls te signal-protocol segment-routing mpls te tunnel-id 100 mpls te path explicit-path path2pe2 # ospf 1 opaque-capability enable segment-routing mpls segment-routing global-block 16000 47999 area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 10.10.1.0 0.0.0.255 mpls-te enable # tunnel-policy policy1 tunnel binding destination 3.3.3.9 te Tunnel10 # return
P的配置文件
# sysname P # mpls lsr-id 2.2.2.9 # mpls mpls te # segment-routing # interface GigabitEthernet0/1/1 undo shutdown ip address 10.10.1.2 255.255.255.0 ospf cost 1 # interface GigabitEthernet0/1/2 undo shutdown ip address 10.20.1.1 255.255.255.0 ospf cost 1 # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 ospf enable 1 area 0.0.0.0 ospf prefix-sid absolute 16300 # ospf 1 opaque-capability enable segment-routing mpls segment-routing global-block 16000 47999 area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 10.10.1.0 0.0.0.255 network 10.20.1.0 0.0.0.255 mpls-te enable # return
PE2的配置文件
#sysname PE2 # mpls lsr-id 3.3.3.9 # mpls mpls te # mpls l2vpn # vsi a2 pwsignal ldp vsi-id 2 peer 1.1.1.9 tnl-policy policy1 # explicit-path path2pe1 next sid label 16300 type prefix next sid label 16100 type prefix # segment-routing # interface GigabitEthernet0/1/0 undo shutdown # interface GigabitEthernet0/1/0.1 undo shutdown vlan-type dot1q 10 l2 binding vsi a2 # interface GigabitEthernet0/1/1 undo shutdown ip address 10.20.1.2 255.255.255.0 ospf cost 1 # interface GigabitEthernet0/1/2 undo shutdown # interface GigabitEthernet0/1/2.1 undo shutdown vlan-type dot1q 10 l2 binding vsi a2 # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 ospf enable 1 area 0.0.0.0 ospf prefix-sid absolute 16200 # interface Tunnel10 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 1.1.1.9 mpls te signal-protocol segment-routing mpls te tunnel-id 100 mpls te path explicit-path path2pe1 # ospf 1 opaque-capability enable segment-routing mpls segment-routing global-block 16000 47999 area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 10.20.1.0 0.0.0.255 mpls-te enable # tunnel-policy policy1 tunnel binding destination 1.1.1.9 te Tunnel10 # return
CE2的配置文件
# sysname CE2 # interface GigabitEthernet0/1/1 undo shutdown # interface GigabitEthernet0/1/1.1 undo shutdown vlan-type dot1q 10 ip address 10.1.1.2 255.255.255.0 # return