配置Martini方式VPLS over TE示例
组网需求
如图6-34,某企业机构,自建骨干网。分支site站点较少,同时PE间支持建立MPLS TE隧道。分支Site1使用CE1连接PE1设备接入骨干网,分支Site2使用CE2连接PE2接入骨干网。现在Site1和Site2的用户需要进行二层业务的互通,同时要求在穿越骨干网时保留二层报文中用户信息。
配置思路
采用如下的思路配置Martini方式VPLS over TE:
为实现Site1和Site2的二层业务互通,同时在穿越骨干网时保留二层报文的用户信息,故需要使用VPLS技术在骨干网透传二层报文。
由于企业网络结构的Site站点较少,可以选择Martini方式的VPLS,实现各CE设备二层网络的互通。
为实现PE间数据的公网传输,需要在骨干网上配置IGP路由协议实现互通。
VPLS实现依靠MPLS基本功能,故需要在骨干网上的设备配置MPLS基本功能和LDP,同时在PE之间建立远端LDP会话。
为使PE间传输的数据不被公网感知,需要在PE间建立TE隧道。
为实现VPLS功能,需要在PE上使能MPLS L2VPN。
为实现MPLS TE隧道承载VPLS业务,需要在PE上配置相应的隧道策略并在VSI中引用。
为实现Martini方式VPLS,需要在PE上创建VSI,指定信令为LDP,然后将VSI与AC接口绑定。
操作步骤
- 配置接口所属的VLAN
# 配置PE1。P、PE2、CE1和CE2的配置与PE1类似,不再赘述。
<HUAWEI> system-view [HUAWEI] sysname PE1 [PE1] vlan batch 10 20 [PE1] interface vlanif 20 [PE1-Vlanif20] ip address 100.1.1.1 255.255.255.0 [PE1-Vlanif20] quit [PE1] interface gigabitethernet 1/0/0 [PE1-GigabitEthernet1/0/0] port link-type trunk [PE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 20 [PE1-GigabitEthernet1/0/0] quit [PE1] interface gigabitethernet 2/0/0 [PE1-GigabitEthernet2/0/0] port link-type trunk [PE1-GigabitEthernet2/0/0] port trunk allow-pass vlan 10 [PE1-GigabitEthernet2/0/0] quit
- 配置IGP,本例中使用OSPF
配置OSPF时,注意需要发布PE1、P和PE2的32位Loopback接口地址(LSR-ID)。
在PE1、P和PE2上配置OSPF。
#配置PE1。P和PE2的配置与PE1类似,不再赘述。
[PE1] interface loopback 1 [PE1-LoopBack1] ip address 1.1.1.9 255.255.255.255 [PE1-LoopBack1] quit [PE1] ospf 1 [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 100.1.1.0 0.0.0.255 [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
配置完成后,在PE1、P和PE2上执行display ip routing-table命令可以看到已学到彼此的路由。
- 使能MPLS、MPLS TE、MPLS RSVP-TE及MPLS TE CSPF
在隧道沿途各节点的系统视图及接口视图下使能MPLS、MPLS TE和MPLS RSVP-TE,并在隧道入节点使能MPLS TE CSPF。
# 配置PE1。
[PE1] mpls lsr-id 1.1.1.9 [PE1] mpls [PE1-mpls] mpls te [PE1-mpls] mpls rsvp-te [PE1-mpls] mpls te cspf [PE1-mpls] quit [PE1] interface vlanif 20 [PE1-Vlanif20] mpls [PE1-Vlanif20] mpls te [PE1-Vlanif20] mpls rsvp-te [PE1-Vlanif20] quit
# 配置P。
[P] mpls lsr-id 2.2.2.9 [P] mpls [P-mpls] mpls te [P-mpls] mpls rsvp-te [P-mpls] quit [P] interface vlanif 20 [P-Vlanif20] mpls [P-Vlanif20] mpls te [P-Vlanif20] mpls rsvp-te [P-Vlanif20] quit [P] interface vlanif 30 [P-Vlanif30] mpls [P-Vlanif30] mpls te [P-Vlanif30] mpls rsvp-te [P-Vlanif30] quit
# 配置PE2。
[PE2] mpls lsr-id 3.3.3.9 [PE2] mpls [PE2-mpls] mpls te [PE2-mpls] mpls rsvp-te [PE2-mpls] mpls te cspf [PE2-mpls] quit [PE2] interface vlanif 30 [PE2-Vlanif30] mpls [PE2-Vlanif30] mpls te [PE2-Vlanif30] mpls rsvp-te [PE2-Vlanif30] quit
- 在骨干网上配置OSPF TE
# 配置PE1。
[PE1] ospf [PE1-ospf-1] opaque-capability enable [PE1-ospf-1] area 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] mpls-te enable [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
# 配置P。
[P] ospf [P-ospf-1] opaque-capability enable [P-ospf-1] area 0.0.0.0 [P-ospf-1-area-0.0.0.0] mpls-te enable [P-ospf-1-area-0.0.0.0] quit [P-ospf-1] quit
# 配置PE2。
[PE2] ospf [PE2-ospf-1] opaque-capability enable [PE2-ospf-1] area 0.0.0.0 [PE2-ospf-1-area-0.0.0.0] mpls-te enable [PE2-ospf-1-area-0.0.0.0] quit [PE2-ospf-1] quit
- 配置Tunnel接口
# 在PE上创建Tunnel接口,指定隧道协议为MPLS TE,信令协议为RSVP-TE。
# 配置PE1。
[PE1] interface tunnel 1 [PE1-Tunnel1] ip address unnumbered interface loopback 1 [PE1-Tunnel1] tunnel-protocol mpls te [PE1-Tunnel1] destination 3.3.3.9 [PE1-Tunnel1] mpls te tunnel-id 100 [PE1-Tunnel1] mpls te reserved-for-binding [PE1-Tunnel1] mpls te commit [PE1-Tunnel1] quit
# 配置PE2。
[PE2] interface tunnel 1 [PE2-Tunnel1] ip address unnumbered interface loopback 1 [PE2-Tunnel1] tunnel-protocol mpls te [PE2-Tunnel1] destination 1.1.1.9 [PE2-Tunnel1] mpls te tunnel-id 100 [PE2-Tunnel1] mpls te reserved-for-binding [PE2-Tunnel1] mpls te commit [PE2-Tunnel1] quit
配置完此步骤后,在隧道接口视图下执行display this interface命令,可以看见MPLS TE隧道已建立成功,即显示结果中“Line protocol current state”对应值为“UP”。
在系统视图下执行display tunnel-info all命令,可以看到PE之间存在目的地址为对方MPLS LSR ID的TE隧道。以PE1的显示为例。
[PE1] display tunnel-info all * -> Allocated VC Token Tunnel ID Type Destination Token ---------------------------------------------------------------------- 0x4 cr lsp 3.3.3.9 109 0x5 lsp 3.3.3.9 110
- 配置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
# 配置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
配置完此步骤,PE间的LDP会话应能建立起来。
以PE1的显示为例:
[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 ------------------------------------------------------------------------------ 3.3.3.9:0 Operational DU Passive 0000:00:06 95/95 ------------------------------------------------------------------------------ TOTAL: 1 session(s) Found.
- 配置隧道策略
# 配置PE1。
[PE1] tunnel-policy policy1 [PE1-tunnel-policy-policy1] tunnel binding destination 3.3.3.9 te tunnel 1 [PE1-tunnel-policy-policy1] quit
# 配置PE2。
[PE2] tunnel-policy policy1 [PE2-tunnel-policy-policy1] tunnel binding destination 1.1.1.9 te tunnel 1 [PE2-tunnel-policy-policy1] quit
- 在PE上使能MPLS L2VPN
# 配置PE1。
[PE1] mpls l2vpn [PE1-l2vpn] quit
# 配置PE2。
[PE2] mpls l2vpn [PE2-l2vpn] quit
- 在PE上创建VSI,并配置隧道策略。
# 配置PE1。
[PE1] vsi a2 static [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-vsi-a2] quit
# 配置PE2。
[PE2] vsi a2 static [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-vsi-a2] quit
- 在PE上配置VSI与接口的绑定
# 配置PE1。
[PE1] interface vlanif 10 [PE1-Vlanif10] l2 binding vsi a2 [PE1-Vlanif10] quit
# 配置PE2。
[PE2] interface vlanif 40 [PE2-Vlanif40] l2 binding vsi a2 [PE2-Vlanif40] quit
- 检查配置结果
在网络稳定后,在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 : 3 PW Signaling : ldp Member Discovery Style : static PW MAC Learn Style : unqualify Encapsulation Type : vlan MTU : 1500 Diffserv Mode : uniform Mpls Exp : -- DomainId : 255 Domain Name : Ignore AcState : disable P2P VSI : disable Create Time : 0 days, 0 hours, 30 minutes, 6 seconds VSI State : up VSI ID : 2 *Peer Router ID : 3.3.3.9 Negotiation-vc-id : 2 primary or secondary : primary ignore-standby-state : no VC Label : 1026 Peer Type : dynamic Session : up Tunnel ID : 0x4 Broadcast Tunnel ID : 0x4 Broad BackupTunnel ID : 0x0 Tunnel Policy Name : policy1 CKey : 5 NKey : 4 Stp Enable : 0 PwIndex : 0 Control Word : disable Interface Name : Vlanif10 State : up Access Port : false Last Up Time : 2012/08/20 15:11:06 Total Up Time : 0 days, 0 hours, 28 minutes, 37 seconds **PW Information: *Peer Ip Address : 3.3.3.9 PW State : up Local VC Label : 1026 Remote VC Label : 1025 Remote Control Word : disable PW Type : label Local VCCV : alert lsp-ping bfd Remote VCCV : alert lsp-ping bfd Tunnel ID : 0x4 Broadcast Tunnel ID : 0x4 Broad BackupTunnel ID : 0x0 Ckey : 0x5 Nkey : 0x4 Main PW Token : 0x4 Slave PW Token : 0x0 Tnl Type : CR-LSP OutInterface : Tunnel1 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2012/08/20 15:12:16 PW Total Up Time : 0 days, 0 hours, 27 minutes, 27 seconds
在PE1上执行display mpls lsp include 3.3.3.9 32 verbose命令,可以看到去往3.3.3.9/32的LSP的情况。
[PE1] display mpls lsp include 3.3.3.9 32 verbose ------------------------------------------------------------------------------- LSP Information: RSVP LSP ------------------------------------------------------------------------------- No : 1 SessionID : 100 IngressLsrID : 1.1.1.9 LocalLspID : 1 Tunnel-Interface : Tunnel1 Fec : 3.3.3.9/32 TunnelTableIndex : 0x0 Nexthop : 100.1.1.2 In-Label : NULL Out-Label : 1024 In-Interface : ---------- Out-Interface : Vlanif20 LspIndex : 2048 Token : 0x5 LsrType : Ingress Mpls-Mtu : 1500 TimeStamp : 3141sec Bfd-State : --- CBfd-Event : 0x0 Bed-State : BED STOP Bed-LastNotifyValue : --- Bed-LastNotifyLspId : ---
在PE1上执行display vsi pw out-interface vsi a2 命令,可以看到1.1.1.9与3.3.3.9之间建立的MPLS TE隧道的出接口为Tunnel1,实际出接口为VLANIF20。
[PE1] display vsi pw out-interface vsi a2 Total: 1 -------------------------------------------------------------------------------- Vsi Name peer vcid interface -------------------------------------------------------------------------------- a2 3.3.3.9 2 Tunnel1 Vlanif20
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=1 ms Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=1 ms --- 10.1.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/1 ms
CE1 Ping通CE2后,在PE上执行display interface tunnel 1命令查看Tunnel接口信息,可看到显示信息结果中,经过该接口的数据包的统计数据变大了。以PE1的显示为例:
[PE1] display interface tunnel 1 Tunnel1 current state : UP Line protocol current state : UP Last line protocol up time : 2012-08-20 14:50:22 Description: Route Port,The Maximum Transmit Unit is 1500 Internet Address is unnumbered, using address of LoopBack1(1.1.1.9/32) Encapsulation is TUNNEL, loopback not set Tunnel destination 3.3.3.9 Tunnel up/down statistics 1 Tunnel protocol/transport MPLS/MPLS, ILM is available, primary tunnel id is 0x5, secondary tunnel id is 0x0 Current system time: 2012-08-20 15:54:54+00:00 300 seconds output rate 0 bits/sec, 0 packets/sec 0 seconds output rate 0 bits/sec, 0 packets/sec 1249 packets output, 21526 bytes 0 output error 0 output drop Input bandwidth utilization : 0% Output bandwidth utilization : 0%
配置文件
CE1的配置文件
# sysname CE1 # vlan batch 10 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 10 # return
PE1的配置文件
# sysname PE1 # vlan batch 10 20 # mpls lsr-id 1.1.1.9 mpls mpls te mpls rsvp-te mpls te cspf # mpls l2vpn # vsi a2 static pwsignal ldp vsi-id 2 peer 3.3.3.9 tnl-policy policy1 # mpls ldp # mpls ldp remote-peer 3.3.3.9 remote-ip 3.3.3.9 # interface Vlanif10 l2 binding vsi a2 # interface Vlanif20 ip address 100.1.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 10 # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.9 mpls te tunnel-id 100 mpls te reserved-for-binding mpls te commit # ospf 1 opaque-capability enable area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 100.1.1.0 0.0.0.255 mpls-te enable # tunnel-policy policy1 tunnel binding destination 3.3.3.9 te Tunnel1 # return
P的配置文件
# sysname P # vlan batch 20 30 # mpls lsr-id 2.2.2.9 mpls mpls te mpls rsvp-te # interface Vlanif20 ip address 100.1.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface Vlanif30 ip address 100.2.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 30 # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 100.1.1.0 0.0.0.255 network 100.2.1.0 0.0.0.255 mpls-te enable # return
PE2的配置文件
# sysname PE2 # vlan batch 30 40 # mpls lsr-id 3.3.3.9 mpls mpls te mpls rsvp-te mpls te cspf # mpls l2vpn # vsi a2 static pwsignal ldp vsi-id 2 peer 1.1.1.9 tnl-policy policy1 # mpls ldp # mpls ldp remote-peer 1.1.1.9 remote-ip 1.1.1.9 # interface Vlanif30 ip address 100.2.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface Vlanif40 l2 binding vsi a2 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 30 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 40 # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 1.1.1.9 mpls te tunnel-id 100 mpls te reserved-for-binding mpls te commit # ospf 1 opaque-capability enable area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 100.2.1.0 0.0.0.255 mpls-te enable # tunnel-policy policy1 tunnel binding destination 1.1.1.9 te Tunnel1 # return
CE2的配置文件
# sysname CE2 # vlan batch 40 # interface Vlanif40 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 40 # return