配置使用MPLS TE隧道的VLL示例
组网需求
如图4-30,运营商MPLS网络为用户提供L2VPN服务,其中PE1和PE2作为用户接入设备,接入的用户数量较多且经常变化。现要求一种适当的VPN方案,为用户提供安全的VPN服务,提供相对可靠的公网隧道,并且在接入新用户时配置简单。
缺省情况下,设备上全局使能链路类型自协商功能,若L2VPN使用Vlanif接口作为AC接口,则与该功能相冲突,需要先在系统视图下执行lnp disable命令去使能链路类型自协商功能。
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
配置思路
MPLS TE隧道能够提供FRR、Hot-standby等功能,提高了隧道本身的可靠性。
CE1和CE2之间建议采用建立Martini方式的VLL方式进行连接,公网隧道采用TE隧道。
采用如下的思路配置使用MPLS TE隧道的VLL的基本功能:
配置各接口VLAN和VLANIF接口的IP地址,并在骨干网相关设备(PE、P)上配置IGP路由协议实现互通。
建立MPLS TE隧道,并配置相应隧道策略。
在PE之间建立远端LDP会话,用于将本端VC标签传递给对端。
PE上创建VC连接,并应用隧道策略选中MPLS TE隧道。
操作步骤
- 按图4-30配置CE、PE和P的各接口所属VLAN和VLANIF接口的IP地址,并在骨干网相关设备(PE、P)上配置IGP路由协议实现互通。
# 配置CE1。CE2的配置与CE1类似,此处不再赘述。
<HUAWEI> system-view [HUAWEI] sysname CE1 [CE1] vlan batch 10 [CE1] interface vlanif 10 [CE1-Vlanif10] ip address 192.168.1.1 255.255.255.0 [CE1-Vlanif10] quit [CE1] interface gigabitethernet 1/0/0 [CE1-GigabitEthernet1/0/0] port link-type trunk [CE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 10 [CE1-GigabitEthernet1/0/0] quit
# 配置PE1。P和PE2的配置与PE1类似,此处不再赘述。
<HUAWEI> system-view [HUAWEI] sysname PE1 [PE1] vlan batch 10 100 [PE1] interface vlanif 100 [PE1-Vlanif100] ip address 172.1.1.1 255.255.255.0 [PE1-Vlanif100] quit [PE1] interface loopback 1 [PE1-LoopBack1] ip address 1.1.1.9 255.255.255.255 [PE1-LoopBack1] quit [PE1] interface gigabitethernet 1/0/0 [PE1-GigabitEthernet1/0/0] port link-type trunk [PE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 10 [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 100 [PE1-GigabitEthernet2/0/0] quit [PE1] ospf 1 [PE1-ospf-1] area 0 [PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255 [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] quit [PE1-ospf-1] quit
- 建立MPLS TE隧道,并配置相应隧道策略选中MPLS TE隧道。
在各节点全局使能MPLS、MPLS TE和RSVP-TE,在隧道沿途的接口上使能MPLS、MPLS TE和RSVP-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 100 [PE1-Vlanif100] mpls [PE1-Vlanif100] mpls te [PE1-Vlanif100] mpls rsvp-te [PE1-Vlanif100] 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 100 [P-Vlanif100] mpls [P-Vlanif100] mpls te [P-Vlanif100] mpls rsvp-te [P-Vlanif100] quit [P] interface vlanif 200 [P-Vlanif200] mpls [P-Vlanif200] mpls te [P-Vlanif200] mpls rsvp-te [P-Vlanif200] 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 200 [PE2-Vlanif200] mpls [PE2-Vlanif200] mpls te [PE2-Vlanif200] mpls rsvp-te [PE2-Vlanif200] quit
在MPLS骨干网上配置OSPF TE,发布TE信息
# 配置PE1。P和PE2的配置与PE1类似,此处不再赘述。
[PE1] ospf 1 [PE1-ospf-1] opaque-capability enable [PE1-ospf-1] area 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
配置MPLS TE隧道接口,使能MPLS TE CSPF
在隧道入节点上创建Tunnel接口,并配置Tunnel接口的IP地址、隧道协议、目的地址、Tunnel ID、动态信令协议,并执行mpls te commit命令使配置生效。
# 配置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 signal-protocol rsvp-te [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 signal-protocol rsvp-te [PE2-Tunnel1] mpls te commit [PE2-Tunnel1] quit
配置完成后,在两端的PE设备上display mpls te tunnel-interface命令可以看到MPLS TE隧道是否建立成功。以PE1为例:
[PE1]display mpls te tunnel-interface ---------------------------------------------------------------- Tunnel1 ---------------------------------------------------------------- Tunnel State Desc : UP Active LSP : Primary LSP Session ID : 100 Ingress LSR ID : 1.1.1.9 Egress LSR ID: 3.3.3.9 Admin State : UP Oper State : UP Primary LSP State : UP Main LSP State : READY LSP ID : 1
配置隧道绑定策略
# 配置PE1
[PE1] interface tunnel 1 [PE1-Tunnel1] mpls te reserved-for-binding [PE1-Tunnel1] mpls te commit [PE1-Tunnel1] quit [PE1] tunnel-policy 1 [PE1-tunnel-policy-1] tunnel binding destination 3.3.3.9 te tunnel 1 [PE1-tunnel-policy-1] quit
# 配置PE2
[PE2] interface tunnel 1 [PE2-Tunnel1] mpls te reserved-for-binding [PE2-Tunnel1] mpls te commit [PE2-Tunnel1] quit [PE2] tunnel-policy 1 [PE2-tunnel-policy-1] tunnel binding destination 1.1.1.9 te tunnel 1 [PE2-tunnel-policy-1] quit
- 在PE之间建立远端LDP会话
# 配置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
上述配置完成后,在PE1上执行display mpls ldp session命令查看LDP会话的建立情况,可以看到增加了与PE2的远端LDP会话,状态为Operational,表示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:00 1/1 ------------------------------------------------------------------------------ TOTAL: 1 session(s) Found.
- PE上创建VC连接,并应用隧道策略选中MPLS TE隧道。
# 配置PE1。由于本举例使用Vlanif接口作为AC接口,执行以下步骤前必须在系统视图下执行lnp disable命令。如果现网环境不能去使能链路类型自协商功能,请使用非Vlanif接口作为AC接口。
[PE1] mpls l2vpn [PE1-l2vpn] quit [PE1] interface vlanif 10 [PE1-Vlanif10] mpls l2vc 3.3.3.9 101 tunnel-policy 1 [PE1-Vlanif10] quit
# 配置PE2。由于本举例使用Vlanif接口作为AC接口,执行以下步骤前必须在系统视图下执行lnp disable命令。如果现网环境不能去使能链路类型自协商功能,请使用非Vlanif接口作为AC接口。
[PE2] mpls l2vpn [PE2-l2vpn] quit [PE2] interface vlanif 20 [PE2-Vlanif20] mpls l2vc 1.1.1.9 101 tunnel-policy 1 [PE2-Vlanif20] quit
- 验证配置结果
在PE上查看L2VPN连接信息,可以看到建立了一条L2 VC,状态为UP。
以PE1的显示为例:
[PE1] display mpls l2vc interface vlanif 10 *client interface : Vlanif10 is up Administrator PW : no session state : up AC status : up VC state : up Label state : 0 Token state : 0 VC ID : 101 VC type : VLAN destination : 3.3.3.9 local group ID : 0 remote group ID : 0 local VC label : 1026 remote VC label : 1032 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 : 1 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 : cr lsp, TNL ID : 0x48000002 Backup TNL type : lsp , TNL ID : 0x0 create time : 0 days, 4 hours, 16 minutes, 25 seconds up time : 0 days, 4 hours, 15 minutes, 58 seconds last change time : 0 days, 4 hours, 15 minutes, 58 seconds VC last up time : 2013/01/09 22:57:04 VC total up time : 0 days, 4 hours, 15 minutes, 58 seconds CKey : 4 NKey : 3 PW redundancy mode : frr AdminPw interface : -- AdminPw link state : -- Diffserv Mode : uniform Service Class : be Color : -- DomainId : -- Domain Name : --
CE1和CE2能够相互Ping通。
以CE1的显示为例:
[CE1] ping 192.168.1.2 PING 192.168.1.2: 56 data bytes, press CTRL_C to break Reply from 192.168.1.2: bytes=56 Sequence=1 ttl=255 time=10 ms Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=255 time=10 ms Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=255 time=10 ms --- 192.168.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/6/10 ms
配置文件
CE1的配置文件
# sysname CE1 # vlan batch 10 # interface Vlanif10 ip address 192.168.1.1 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 10 # return
PE1的配置文件
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
# sysname PE1 # vlan batch 10 100 # lnp disable # mpls lsr-id 1.1.1.9 mpls mpls te mpls rsvp-te mpls te cspf # mpls l2vpn # mpls ldp # mpls ldp remote-peer 3.3.3.9 remote-ip 3.3.3.9 # interface Vlanif10 mpls l2vc 3.3.3.9 101 tunnel-policy 1 # interface Vlanif100 ip address 172.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 10 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 100 # 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 172.1.1.0 0.0.0.255 mpls-te enable # tunnel-policy 1 tunnel binding destination 3.3.3.9 te Tunnel1 # return
P的配置文件
# sysname P # vlan batch 100 200 # mpls lsr-id 2.2.2.9 mpls mpls te mpls rsvp-te # interface Vlanif100 ip address 172.1.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface Vlanif200 ip address 172.1.2.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 200 # 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 172.1.1.0 0.0.0.255 network 172.1.2.0 0.0.0.255 mpls-te enable # return
PE2的配置文件
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
# sysname PE2 # vlan batch 20 200 # lnp disable # mpls lsr-id 3.3.3.9 mpls mpls te mpls rsvp-te mpls te cspf # mpls l2vpn # mpls ldp # mpls ldp remote-peer 1.1.1.9 remote-ip 1.1.1.9 # interface Vlanif20 mpls l2vc 1.1.1.9 101 tunnel-policy 1 # interface Vlanif200 ip address 172.1.2.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 200 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 20 # 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 172.1.2.0 0.0.0.255 mpls-te enable # tunnel-policy 1 tunnel binding destination 1.1.1.9 te Tunnel1 # return
CE2的配置文件
# sysname CE2 # vlan batch 20 # interface Vlanif20 ip address 192.168.1.2 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 20 # return