配置CCC远程连接示例
组网需求
如图4-25,位于不同物理位置的用户网络站点分别通过CE1和CE2设备接入运营商MPLS网络。为简化配置,用户希望两个CE间达到在同一局域网中相互通信的效果。该用户的站点数量不会进行扩充,希望在运营商网络中能够得到独立的VPN资源,以保证数据的安全。
CE1和CE2之间可以建立CCC远程连接,直接完成二层数据的交换。
缺省情况下,设备上全局使能链路类型自协商功能,若L2VPN使用Vlanif接口作为AC接口,则与该功能相冲突,需要先在系统视图下执行lnp disable命令去使能链路类型自协商功能。
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
配置思路
考虑用户希望两个CE间达到在同一局域网中相互通信的效果,可采用VLL方式进行VPN的组网。而用户站点数量不会扩充,为在运营商网络中得到独立的VPN资源,保证数据的安全,可采用CCC远程连接方式,来满足客户需求。
采用如下的思路配置CCC远程连接的基本功能:
在PE设备上使能MPLS L2VPN,而P设备上不需要使能MPLS L2VPN。使能MPLS L2VPN是配置VLL的前提。
在PE上创建CCC远程连接。创建CCC远程连接需设定入接口、入标签、出标签及下一跳,是建立CCC远程连接的核心步骤。
配置双向的转发静态LSP,用于PE之间CCC连接独享数据隧道。
操作步骤
- 按图4-25配置各接口所属VLAN和VLANIF接口的IP地址
# 配置CE1。CE2、PE1、P和PE2的配置与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
CE发送到PE的报文需携带VLAN tag。
- 在MPLS骨干网上配置MPLS基本能力
# 配置PE1。
[PE1] interface loopback 1 [PE1-LoopBack1] ip address 1.1.1.9 32 [PE1-LoopBack1] quit [PE1] mpls lsr-id 1.1.1.9 [PE1] mpls [PE1-mpls] quit [PE1] interface vlanif 20 [PE1-Vlanif20] mpls [PE1-Vlanif20] quit
# 配置P。
[P] interface loopback 1 [P-LoopBack1] ip address 2.2.2.9 32 [P-LoopBack1] quit [P] mpls lsr-id 2.2.2.9 [P] mpls [P-mpls] quit [P] interface vlanif 20 [P-Vlanif20] mpls [P-Vlanif20] quit [P] interface vlanif 30 [P-Vlanif30] mpls [P-Vlanif30] quit
# 配置PE2。
[PE2] interface loopback 1 [PE2-LoopBack1] ip address 3.3.3.9 32 [PE2-LoopBack1] quit [PE2] mpls lsr-id 3.3.3.9 [PE2] mpls [PE2-mpls] quit [PE2] interface vlanif 30 [PE2-Vlanif30] mpls [PE2-Vlanif30] quit
- 在PE上创建CCC远程连接
# 配置PE1:全局使能MPLS L2VPN,并创建CE1到CE2的CCC远程连接:入接口连接CE1,下一跳为P的VLANIF 20的IP地址,入标签为100,出标签为200。由于本举例使用Vlanif接口作为AC接口,执行以下步骤前必须在系统视图下执行lnp disable命令。如果现网环境不能去使能链路类型自协商功能,请使用非Vlanif接口作为AC接口。
[PE1] mpls l2vpn [PE1-l2vpn] quit [PE1] interface vlanif 10 [PE1-Vlanif10] quit [PE1] ccc CE1-CE2 interface vlanif 10 in-label 100 out-label 200 nexthop 10.1.1.2
# 配置PE2:全局使能mpls l2vpn,并创建CE2到CE1的CCC远程连接:入接口连接CE2,下一跳为P的VLANIF 30的IP地址,入标签为201,出标签为101。由于本举例使用Vlanif接口作为AC接口,执行以下步骤前必须在系统视图下执行lnp disable命令。如果现网环境不能去使能链路类型自协商功能,请使用非Vlanif接口作为AC接口。
[PE2] mpls l2vpn [PE2-l2vpn] quit [PE2] interface vlanif 40 [PE2-Vlanif40] quit [PE2] ccc CE2-CE1 interface vlanif 40 in-label 201 out-label 101 nexthop 10.2.2.2
- 在P上配置转发静态LSP
# 配置P:配置一条静态LSP用于转发由PE1去往PE2的报文,另一条静态LSP用于转发由PE2去往PE1的报文。
[P] static-lsp transit PE1-PE2 incoming-interface vlanif 20 in-label 200 nexthop 10.2.2.1 out-label 201 [P] static-lsp transit PE2-PE1 incoming-interface vlanif 30 in-label 101 nexthop 10.1.1.1 out-label 100
- 验证配置结果
配置完成后,在PE上查看CCC连接信息,可以看到PE1和PE2上各自建立了一条CCC远程连接,状态为Up。
[PE1] display vll ccc total ccc vc : 1 local ccc vc : 0, 0 up remote ccc vc : 1, 1 up name: CE1-CE2, type: remote, state: up, intf: Vlanif10 (up), in-label: 100 , out-label: 200 , nexthop: 10.1.1.2 VC last up time : 2009/10/09 17:35:14 VC total up time: 0 days, 3 hours, 22 minutes, 55 seconds
[PE2] display vll ccc total ccc vc : 1 local ccc vc : 0, 0 up remote ccc vc : 1, 1 up name: CE2-CE1, type: remote, state: up, intf: Vlanif40 (up), in-label: 201 , out-label: 101 , nexthop: 10.2.2.2 VC last up time : 2009/10/09 17:35:14 VC total up time: 0 days, 3 hours, 22 minutes, 55 seconds
在PE上执行命令display l2vpn ccc-interface vc-type ccc,可以看到VC Type为CCC,状态为Up。以PE1的显示为例:
[PE1] display l2vpn ccc-interface vc-type ccc Total ccc-interface of CCC : 1 up (1), down (0) Interface Encap Type State VC Type Vlanif10 ethernet up ccc
在P上执行display mpls lsp命令,可以看到建立的两条静态LSP的标签信息和接口信息:
[P] display mpls lsp ------------------------------------------------------------------------------- LSP Information: STATIC LSP ------------------------------------------------------------------------------- FEC In/Out Label In/Out IF Vrf Name -/- 200/201 Vlanif20/Vlanif30 -/- 101/100 Vlanif30/Vlanif20
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=58 ms Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=255 time=67 ms Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=255 time=52 ms Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=255 time=69 ms Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=255 time=92 ms --- 192.168.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 52/67/92 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 20 # lnp disable # mpls lsr-id 1.1.1.9 mpls # mpls l2vpn # interface Vlanif10 # interface Vlanif20 ip address 10.1.1.1 255.255.255.0 mpls # 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 20 # ccc CE1-CE2 interface Vlanif10 in-label 100 out-label 200 nexthop 10.1.1.2 # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # return
P的配置文件
# sysname P # vlan batch 20 30 # mpls lsr-id 2.2.2.9 mpls # interface Vlanif20 ip address 10.1.1.2 255.255.255.0 mpls # interface Vlanif30 ip address 10.2.2.2 255.255.255.0 mpls # 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 20 # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # static-lsp transit PE1-PE2 incoming-interface Vlanif20 in-label 200 nexthop 10.2.2.1 out-label 201 static-lsp transit PE2-PE1 incoming-interface Vlanif30 in-label 101 nexthop 10.1.1.1 out-label 100 # return
PE2的配置文件
使用lnp disable命令之后,设备重启前对业务没有影响,设备重启后只有命令port default vlan指定的VLAN二层转发可通,其他VLAN二层转发不通。缺省情况下,接口的配置是port default vlan 1,即只有VLAN 1二层转发可通。
# sysname PE2 # vlan batch 30 40 # lnp disable # mpls lsr-id 3.3.3.9 mpls # mpls l2vpn # interface Vlanif30 ip address 10.2.2.1 255.255.255.0 mpls # interface Vlanif40 # 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 # ccc CE2-CE1 interface Vlanif40 in-label 201 out-label 101 nexthop 10.2.2.2 # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # return
CE2的配置文件
# sysname CE2 # vlan batch 40 # interface Vlanif40 ip address 192.168.1.2 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 40 # return