配置CE双归属示例
组网需求
随着电信业务的发展,各种电信业务将用统一的IP网络承载。3G/NGN、IPTV流媒体、大客户VPN等重要业务的部署要求网络具有极高的可靠性。提高网络的可靠性,除了考虑网络设备自身的可靠性外,还可以从链路可靠性和网络可靠性方面着手,例如路由快速收敛、故障检测、快速重路由和备份。
就接入层来说,CE双归属是提高网络可靠性的常见网络结构。把一个CE与属于同一个VPN的两个PE相连,就将其视为CE双归。此时CE是通过两条链路接入骨干网。这两条链路既可用作负载分担,也可作为主备链路。
例如图3-8,CE1处于vpn1的site1中;CE2处于vpn1的site2中。CE1以双归属方式接入PE1和PE2;CE2以双归属方式接入PE3和PE4。
如果CE1到CE2的数据流量较大,而CE2到CE1的流量很少,则可以配置成允许CE1到CE2的数据以负载分担的方式传输;而CE2到CE1的数据则从PE4传输,PE3只作为备份。
请确保该场景下互联接口的STP处于未使能状态。同时将互连接口退出VLAN1,避免形成环路。因为在使能STP的环形网络中,如果用交换机的VLANIF接口构建三层网络,会导致某个端口被阻塞,从而导致三层业务不能正常运行。
交换机 |
接口 |
对应的VLANIF |
IP地址 |
---|---|---|---|
PE1 |
Loopback1 |
- |
1.1.1.1/32 |
PE1 |
GE1/0/0 |
VLANIF101 |
2001::2/64 |
PE1 |
GE2/0/0 |
VLANIF10 |
100.1.1.1/30 |
PE2 |
Loopback1 |
- |
2.2.2.2/32 |
PE2 |
GE1/0/0 |
VLANIF102 |
2002::2/64 |
PE2 |
GE2/0/0 |
VLANIF20 |
100.2.1.1/30 |
P1 |
Loopback1 |
- |
5.5.5.5/32 |
P1 |
GE1/0/0 |
VLANIF10 |
100.1.1.2/30 |
P1 |
GE2/0/0 |
VLANIF30 |
100.3.1.1/30 |
P2 |
Loopback1 |
- |
6.6.6.6/32 |
P2 |
GE1/0/0 |
VLANIF20 |
100.2.1.2/30 |
P2 |
GE2/0/0 |
VLANIF40 |
100.4.1.1/30 |
PE3 |
Loopback1 |
- |
3.3.3.3/32 |
PE3 |
GE1/0/0 |
VLANIF30 |
100.3.1.2/30 |
PE3 |
GE2/0/0 |
VLANIF103 |
2003::2/64 |
PE4 |
Loopback1 |
- |
4.4.4.4/32 |
PE4 |
GE1/0/0 |
VLANIF40 |
100.4.1.2/30 |
PE4 |
GE2/0/0 |
VLANIF104 |
2004::2/64 |
CE1 |
GE1/0/0 |
VLANIF101 |
2001::1/64 |
CE1 |
GE2/0/0 |
VLANIF102 |
2002::1/64 |
CE1 |
GE3/0/0 |
VLANIF1001 |
2005::1/64 |
CE2 |
GE1/0/0 |
VLANIF103 |
2003::1/64 |
CE2 |
GE2/0/0 |
VLANIF104 |
2004::1/64 |
CE2 |
GE3/0/0 |
VLANIF1002 |
2006::1/64 |
配置思路
本例按照如下思路进行配置:
先配置基本的BGP/MPLS IPv6 VPN
在CE1的BGP视图下配置允许到CE2的数据进行负载分担
在PE3上增大BGP-VPN路由的MED值,使得CE2选择到CE1接入的用户的路由下一跳是PE4
操作步骤
- 创建VLAN,配置各接口允许通过的VLAN,并配置VLANIF接口和Loopback接口IP地址,具体数据如图3-8所示。
# 配置PE1。
<HUAWEI> system-view [HUAWEI] sysname PE1 [PE1] ipv6 [PE1] interface loopback 1 [PE1-LoopBack1] ip address 1.1.1.1 32 [PE1-LoopBack1] quit [PE1] vlan batch 10 101 [PE1] interface gigabitethernet 1/0/0 [PE1-GigabitEthernet1/0/0] port link-type trunk [PE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 101 [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 [PE1] interface vlanif 10 [PE1-Vlanif10] ip address 100.1.1.1 30 [PE1-Vlanif10] quit
P1、P2、PE2、PE3、PE4、CE1、CE2的配置同PE1(略)。
- 在MPLS骨干网上配置IGP协议,实现骨干网PE和P的互通
本例中采用IS-IS,以PE1为例。
# 配置PE1。
[PE1] isis 1 [PE1-isis-1] network-entity 10.0000.0000.0001.00 [PE1-isis-1] quit [PE1] interface loopback 1 [PE1-LoopBack1] isis enable 1 [PE1-LoopBack1] quit [PE1] interface vlanif 10 [PE1-Vlanif10] isis enable 1 [PE1-Vlanif10] quit
PE2、PE3、PE4、P1、P2的配置过程与PE1类似,此处不再赘述。
配置完成后,执行display ip routing-table命令可以看到PE1与PE3、PE2与PE4之间学习到对方的Loopback1路由。
- 在MPLS骨干网上配置MPLS基本能力和MPLS LDP,建立LDP LSP
# 配置PE1。
# 在系统上启动MPLS和LDP,指定LSR-ID为Loopback接口的地址,并触发建立LSP。
[PE1] mpls lsr-id 1.1.1.1 [PE1] mpls [PE1-mpls] quit [PE1] mpls ldp [PE1-mpls-ldp] quit
# 在骨干网的接口上启动MPLS和LDP。
[PE1] interface vlanif 10 [PE1-Vlanif10] mpls [PE1-Vlanif10] mpls ldp [PE1-Vlanif10] quit
# PE2、PE3、PE4、P1、P2上的配置过程与PE1类似。此处不再赘述。
上述配置完成后,PE1与P、P与PE2之间应能建立LDP会话,执行display mpls ldp session命令可以看到显示结果中Status项为“Operational”。执行display mpls ldp lsp命令,可以看到LDP LSP的建立情况。
以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 ------------------------------------------------------------------------------ 5.5.5.5:0 Operational DU Active 0000:09:10 2201/2185 ------------------------------------------------------------------------------ TOTAL: 1 session(s) Found. [PE1] display mpls ldp lsp LDP LSP Information ------------------------------------------------------------------------------- Flag after Out IF: (I) - LSP Is Only Iterated by RLFA ------------------------------------------------------------------------------- DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface ------------------------------------------------------------------------------- 1.1.1.1/32 3/NULL 5.5.5.5 127.0.0.1 InLoop0 *1.1.1.1/32 Liberal/1024 DS/5.5.5.5 3.3.3.3/32 NULL/1025 - 10.1.1.2 Vlanif10 3.3.3.3/32 1025/1025 5.5.5.5 10.1.1.2 Vlanif10 5.5.5.5/32 NULL/3 - 10.1.1.2 Vlanif10 5.5.5.5/32 1024/3 5.5.5.5 10.1.1.2 Vlanif10 ----------------------------------------------------------------------------- TOTAL: 5 Normal LSP(s) Found. TOTAL: 1 Liberal LSP(s) Found. TOTAL: 0 Frr LSP(s) Found. A '*' before an LSP means the LSP is not established A '*' before a Label means the USCB or DSCB is stale A '*' before a UpstreamPeer means the session is stale A '*' before a DS means the session is stale A '*' before a NextHop means the LSP is FRR LSP
- 在PE设备上配置IPv6 VPN实例,将CE接入PE
# 配置PE1。
# 使能IPv6,配置VPN实例,指定RD和VPN-Target。在本PE上配置的VPN-Target应与在MP-BGP对等体PE上配置的VPN-Target对应,以便同一VPN的各Site可互访。
[PE1] ipv6 [PE1] ip vpn-instance vpn1 [PE1-vpn-instance-vpn1] ipv6-family [PE1-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:1 [PE1-vpn-instance-vpn1-af-ipv6] vpn-target 1:1 both [PE1-vpn-instance-vpn1-af-ipv6] quit [PE1-vpn-instance-vpn1] quit
# 将与CE1连接的各接口与对应的VPN绑定,并配置IP地址。
[PE1] interface vlanif 101 [PE1-Vlanif101] ipv6 enable [PE1-Vlanif101] ip binding vpn-instance vpn1 [PE1-Vlanif101] ipv6 address 2001::2 64 [PE1-Vlanif101] quit
# 配置PE2。
# 使能IPv6,配置VPN实例,指定RD和VPN-Target。在本PE上配置的VPN-Target应与在MP-BGP对等体PE上配置的VPN-Target对应,以便同一VPN的各Site可互访。
[PE2] ipv6 [PE2] ip vpn-instance vpn1 [PE2-vpn-instance-vpn1] ipv6-family [PE2-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:2 [PE2-vpn-instance-vpn1-af-ipv6] vpn-target 1:1 both [PE2-vpn-instance-vpn1-af-ipv6] quit [PE2-vpn-instance-vpn1] quit
# 将与CE1连接的各接口与对应的VPN绑定。
[PE2] interface vlanif 102 [PE2-Vlanif102] ipv6 enable [PE2-Vlanif102] ip binding vpn-instance vpn1 [PE2-Vlanif102] ipv6 address 2002::2 64 [PE2-Vlanif102] quit
# 配置PE3。
# 使能IPv6,配置VPN实例,指定RD和VPN-Target。在本PE上配置的VPN-Target应与在MP-BGP对等体PE上配置的VPN-Target对应,以便同一VPN的各Site可互访。
[PE3] ipv6 [PE3] ip vpn-instance vpn1 [PE3-vpn-instance-vpn1] ipv6-family [PE3-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:3 [PE3-vpn-instance-vpn1-af-ipv6] vpn-target 1:1 both [PE3-vpn-instance-vpn1-af-ipv6] quit [PE3-vpn-instance-vpn1] quit
# 将与CE2连接的各接口与对应的VPN绑定,并配置IP地址。
[PE3] interface vlanif 103 [PE3-Vlanif103] ipv6 enable [PE3-Vlanif103] ip binding vpn-instance vpn1 [PE3-Vlanif103] ipv6 address 2003::2 64 [PE3-Vlanif103] quit
# 配置PE4。
# 使能IPv6,配置VPN实例,指定RD和VPN-Target。在本PE上配置的VPN-Target应与在MP-BGP对等体PE上配置的VPN-Target对应,以便同一VPN的各Site可互访。
[PE4] ipv6 [PE4] ipv6 vpn-instance vpn1 [PE4-vpn-instance-vpn1] ipv6-family [PE4-vpn-instance-vpn1-af-ipv6] route-distinguisher 100:4 [PE4-vpn-instance-vpn1-af-ipv6] vpn-target 1:1 both [PE4-vpn-instance-vpn1-af-ipv6] quit [PE4-vpn-instance-vpn1] quit
# 将与CE2连接的各接口与对应的VPN绑定,并配置IP地址。
[PE4] interface vlanif 104 [PE4-Vlanif104] ipv6 enable [PE4-Vlanif104] ip binding vpn-instance vpn1 [PE4-Vlanif104] ipv6 address 2004::2 64 [PE4-Vlanif104] quit
# 按图3-8配置各CE的接口IPv6地址,配置过程略。
配置完成后,在PE设备上执行display ip vpn-instance verbose命令可以看到IPv6 VPN实例的配置情况。
以PE1为例:
[PE1] display ip vpn-instance verbose Total VPN-Instances configured : 1 Total IPv4 VPN-Instances configured : 0 Total IPv6 VPN-Instances configured : 1 VPN-Instance Name and ID : vpn1, 1 Interfaces : Vlanif101 Address family ipv6 Create date : 2012-12-22 14:50:00+00:00 Up time : 0 days, 03 hours, 12 minutes and 12 seconds Route Distinguisher : 100:1 Export VPN Targets : 1:1 Import VPN Targets : 1:1 Label Policy : label per route Log Interval : 5
- 在PE与CE之间配置EBGP路由协议,引入VPN路由
# 配置CE1。
# 启动BGP,并指定PE1和PE2为EBGP对等体,引入直连路由。
[CE1] bgp 65410 [CE1-bgp] router-id 10.10.10.10 [CE1-bgp] peer 2001::2 as-number 100 [CE1-bgp] peer 2002::2 as-number 100 [CE1-bgp] ipv6-family unicast [CE1-bgp-af-ipv6] peer 2001::2 enable [CE1-bgp-af-ipv6] peer 2002::2 enable [CE1-bgp-af-ipv6] import-route direct [CE1-bgp-af-ipv6] quit [CE1-bgp] quit
# 配置PE1。
# 启动BGP,进入BGP-VPN实例IPv6地址族视图,指定CE1为EBGP对等体,引入直连路由。
[PE1] bgp 100 [PE1-bgp] ipv6-family vpn-instance vpn1 [PE1-bgp6-vpn1] peer 2001::1 as-number 65410 [PE1-bgp6-vpn1] import-route direct [PE1-bgp6-vpn1] quit
# 配置PE2。
# 启动BGP,进入BGP-VPN实例IPv6地址族视图,指定CE1为EBGP对等体,引入直连路由。
[PE2] bgp 100 [PE2-bgp] ipv6-family vpn-instance vpn1 [PE2-bgp6-vpn1] peer 2002::1 as-number 65410 [PE2-bgp6-vpn1] import-route direct [PE2-bgp6-vpn1] quit
# 配置CE2。
# 启动BGP,并指定PE3和PE4为EBGP对等体,引入直连路由。
[CE2] bgp 65420 [CE2-bgp] router-id 20.20.20.20 [CE2-bgp] peer 2003::2 as-number 100 [CE2-bgp] peer 2004::2 as-number 100 [CE2-bgp] ipv6-family unicast [CE2-bgp-af-ipv6] peer 2003::2 enable [CE2-bgp-af-ipv6] peer 2004::2 enable [CE2-bgp-af-ipv6] import-route direct [CE2-bgp-af-ipv6] quit [CE2-bgp] quit
# 配置PE3。
# 启动BGP,进入BGP-VPN实例IPv6地址族视图,指定CE2为EBGP对等体,引入直连路由。
[PE3] bgp 100 [PE3-bgp] ipv6-family vpn-instance vpn1 [PE3-bgp6-vpn1] peer 2003::1 as-number 65420 [PE3-bgp6-vpn1] import-route direct [PE3-bgp6-vpn1] quit
# 配置PE4。
# 启动BGP,进入BGP-VPN实例IPv6地址族视图,指定CE2为EBGP对等体,引入直连路由。
[PE4] bgp 100 [PE4-bgp] ipv6-family vpn-instance vpn1 [PE4-bgp6-vpn1] peer 2004::1 as-number 65420 [PE4-bgp6-vpn1] import-route direct [PE4-bgp6-vpn1] quit
配置完成后,在PE设备上执行display bgp vpnv6 vpn-instance vpn-instance-name peer命令,可以看到PE与CE之间的BGP对等体关系已建立,并达到Established状态。各PE能ping通自己接入的CE。
以PE1为例:
[PE1] display bgp vpnv6 vpn-instance vpn1 peer BGP local router ID : 1.1.1.1 Local AS number : 100 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2001::1 4 65410 408 435 0 06:16:09 Established 5 [PE1] ping ipv6 vpn-instance vpn1 2001::1 PING 2001::1 : 56 data bytes, press CTRL_C to break Reply from 2001::1 bytes=56 Sequence=1 hop limit=64 time = 15 ms Reply from 2001::1 bytes=56 Sequence=2 hop limit=64 time = 16 ms Reply from 2001::1 bytes=56 Sequence=3 hop limit=64 time = 15 ms Reply from 2001::1 bytes=56 Sequence=4 hop limit=64 time = 32 ms Reply from 2001::1 bytes=56 Sequence=5 hop limit=64 time = 16 ms --- 2001::1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 15/18/32 ms
- 在PE之间建立MP-IBGP对等体关系
# 配置PE1。
# 指定对端PE3为IBGP对等体,使用Loopback接口建立IBGP连接。
[PE1] bgp 100 [PE1-bgp] peer 3.3.3.3 as-number 100 [PE1-bgp] peer 3.3.3.3 connect-interface loopback 1
# 进入BGP的VPNv6地址簇视图,并启动对等体交换VPN-IPv6路由信息。
[PE1-bgp] ipv6-family vpnv6 [PE1-bgp-af-vpnv6] peer 3.3.3.3 enable [PE1-bgp-af-vpnv6] quit
# 配置PE3。
# 指定对端PE1为IBGP对等体,使用loopback接口建立IBGP连接。
[PE3] bgp 100 [PE3-bgp] peer 1.1.1.1 as-number 100 [PE3-bgp] peer 1.1.1.1 connect-interface loopback 1
# 进入BGP的VPNVv6地址簇视图,并启动对等体交换VPN-IPv6路由信息。
[PE3-bgp] ipv6-family vpnv6 [PE3-bgp-af-vpnv6] peer 1.1.1.1 enable [PE3-bgp-af-vpnv6] quit
# 配置PE2。
# 指定对端PE4为IBGP对等体,使用loopback接口建立IBGP连接。
[PE2] bgp 100 [PE2-bgp] peer 4.4.4.4 as-number 100 [PE2-bgp] peer 4.4.4.4 connect-interface loopback 1
# 进入BGP的VPNv6地址簇视图,并启动对等体交换VPN-IPv6路由信息。
[PE2-bgp] ipv6-family vpnv6 [PE2-bgp-af-vpnv6] peer 4.4.4.4 enable [PE2-bgp-af-vpnv6] quit
# 配置PE4。
# 指定对端PE2为IBGP对等体,使用loopback接口建立IBGP连接。
[PE4] bgp 100 [PE4-bgp] peer 2.2.2.2 as-number 100 [PE4-bgp] peer 2.2.2.2 connect-interface loopback 1
# 进入VPN的VPNv6地址簇视图,并启动对等体交换VPN-IPv6路由信息。
[PE4-bgp] ipv6-family vpnv6 [PE4-bgp-af-vpnv6] peer 2.2.2.2 enable [PE4-bgp-af-vpnv6] quit
配置完成后,在PE设备上执行display bgp vpnv6 all peer命令,可以看到PE之间的BGP对等体关系已建立,并达到Established状态。
[PE1] display bgp vpnv6 all peer BGP local router ID : 1.1.1.1 Local AS number : 100 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 3.3.3.3 4 100 70 81 0 01:00:23 Established 3 Peer of IPv6-family for vpn instance : VPN-Instance vpn1, Router ID 1.1.1.1: 2001::1 4 65410 16 12 0 00:06:42 Established 3
- 在CE1上配置允许CE1到CE2的流量允许负载分担
[CE1] bgp 65410 [CE1-bgp] ipv6-family unicast [CE1-bgp-af-ipv6] maximum load-balancing 2
- 配置路由策略,增大PE3上发布给CE2的BGP路由的MED值,使CE2到CE1的流量流经PE4,PE3作为备份
[PE3] route-policy policy1 permit node 10 [PE3-route-policy] apply cost 120 [PE3-route-policy] quit [PE3] bgp 100 [PE3-bgp] ipv6-family vpn-instance vpn1 [PE3-bgp6-vpn1] peer 2003::1 route-policy policy1 export
- 检查配置结果
在CE2设备上执行display ipv6 routing-table命令,可以看到去往对端CE1所接用户的路由,且下一跳为2004::2(PE4上接入CE2的接口IPv6地址)。
如果配置成功,则:
在CE1设备上执行display ipv6 routing-table命令,可以看到去往对端CE2所接用户的路由,且是负载分担的。
[CE1] display ipv6 routing-table Routing Table : Public Destinations : 11 Routes : 12 Destination : ::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : InLoopBack0 Flags : D Destination : 2001:: PrefixLength : 64 NextHop : 2001::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif101 Flags : D Destination : 2001::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : InLoopBack0 Flags : D Interface : Vlanif101 Flags : D Destination : 2002:: PrefixLength : 64 NextHop : 2002::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif102 Flags : D Destination : 2002::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif102 Flags : D Destination : 2003:: PrefixLength : 64 NextHop : 2001::2 Preference : 255 Cost : 0 Protocol : EBGP RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif101 Flags : D Destination : 2004:: PrefixLength : 64 NextHop : 2002::2 Preference : 255 Cost : 0 Protocol : EBGP RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif102 Flags : D Destination : 2005:: PrefixLength : 64 NextHop : 2005::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif1001 Flags : D Destination : 2005::1 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : InLoopBack0 Flags : D Interface : Vlanif1001 Flags : D Destination : 2006:: PrefixLength : 64 NextHop : 2001::2 Preference : 255 Cost : 0 Protocol : EBGP RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif101 Flags : D Destination : 2006:: PrefixLength : 64 NextHop : 2002::2 Preference : 255 Cost : 0 Protocol : EBGP RelayNextHop : :: TunnelID : 0x0 Interface : Vlanif102 Flags : D Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : D
配置文件
CE1的配置文件
# sysname CE1 # ipv6 # vlan batch 101 102 1001 # interface Vlanif101 ipv6 enable ipv6 address 2001::1/64 # interface Vlanif102 ipv6 enable ipv6 address 2002::1/64 # interface Vlanif1001 ipv6 enable ipv6 address 2005::1/64 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 101 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 102 # interface GigabitEthernet3/0/0 port link-type trunk port trunk allow-pass vlan 1001 # bgp 65410 router-id 10.10.10.10 peer 2001::2 as-number 100 peer 2002::2 as-number 100 # ipv6-family unicast undo synchronization import-route direct maximum load-balancing 2 peer 2001::2 enable peer 2002::2 enable # return
PE1的配置文件
# sysname PE1 # ipv6 # vlan batch 10 101 # ip vpn-instance vpn1 ipv6-family route-distinguisher 100:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 1.1.1.1 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0001.00 # interface Vlanif10 ip address 100.1.1.1 255.255.255.252 isis enable 1 mpls mpls ldp # interface Vlanif101 ipv6 enable ip binding vpn-instance vpn1 ipv6 address 2001::2/64 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 101 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 10 # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 isis enable 1 # bgp 100 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable # ipv6-family vpnv6 policy vpn-target peer 3.3.3.3 enable # ipv6-family vpn-instance vpn1 peer 2001::1 as-number 65410 import-route direct # return
PE2的配置文件
# sysname PE2 # ipv6 # vlan batch 20 102 # ip vpn-instance vpn1 ipv6-family route-distinguisher 100:2 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 2.2.2.2 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0002.00 # interface Vlanif20 ip address 100.2.1.1 255.255.255.252 isis enable 1 mpls mpls ldp # interface Vlanif102 ipv6 enable ip binding vpn-instance vpn1 ipv6 address 2002::2/64 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 102 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 isis enable 1 # bgp 100 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 4.4.4.4 enable # ipv6-family vpnv6 policy vpn-target peer 4.4.4.4 enable # ipv6-family vpn-instance vpn1 peer 2002::1 as-number 65410 import-route direct # return
P1的配置文件
# sysname P1 # vlan batch 10 30 # mpls lsr-id 5.5.5.5 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0005.00 # interface Vlanif10 ip address 100.1.1.2 255.255.255.252 isis enable 1 mpls mpls ldp # interface Vlanif30 ip address 100.3.1.1 255.255.255.252 isis enable 1 mpls mpls ldp # 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 30 # interface LoopBack1 ip address 5.5.5.5 255.255.255.255 isis enable 1 # return
P2的配置文件
# sysname P2 # vlan batch 20 40 # mpls lsr-id 6.6.6.6 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0006.00 # interface Vlanif20 ip address 100.2.1.2 255.255.255.252 isis enable 1 mpls mpls ldp # interface Vlanif40 ip address 100.4.1.1 255.255.255.252 isis enable 1 mpls mpls ldp # 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 40 # interface LoopBack1 ip address 6.6.6.6 255.255.255.255 isis enable 1 # return
PE3的配置文件
sysname PE3 # ipv6 # vlan batch 30 103 # ip vpn-instance vpn1 ipv6-family route-distinguisher 100:3 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 3.3.3.3 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0003.00 # interface Vlanif30 ip address 100.3.1.2 255.255.255.252 isis enable 1 mpls mpls ldp # interface Vlanif103 ipv6 enable ip binding vpn-instance vpn1 ipv6 address 2003::2/64 # 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 103 # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 isis enable 1 # bgp 100 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable # ipv6-family vpnv6 policy vpn-target peer 1.1.1.1 enable # ipv6-family vpn-instance vpn1 peer 2003::1 as-number 65420 peer 2003::1 route-policy policy1 export import-route direct # route-policy policy1 permit node 10 apply cost 120 # return
PE4的配置文件
# sysname PE4 # ipv6 # vlan batch 40 104 # ip vpn-instance vpn1 ipv6-family route-distinguisher 100:4 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 4.4.4.4 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0004.00 # interface Vlanif40 ip address 100.4.1.2 255.255.255.252 isis enable 1 mpls mpls ldp # interface Vlanif104 ipv6 enable ip binding vpn-instance vpn1 ipv6 address 2004::2/64 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 40 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 104 # interface LoopBack1 ip address 4.4.4.4 255.255.255.255 isis enable 1 # bgp 100 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable # ipv6-family vpnv6 policy vpn-target peer 2.2.2.2 enable # ipv6-family vpn-instance vpn1 peer 2004::1 as-number 65420 import-route direct # return
CE2的配置文件
# sysname CE2 # ipv6 # vlan batch 103 104 1002 # interface Vlanif103 ipv6 enable ipv6 address 2003::1/64 # interface Vlanif104 ipv6 enable ipv6 address 2004::1/64 # interface Vlanif1002 ipv6 enable ipv6 address 2006::1/64 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 103 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 104 # interface GigabitEthernet3/0/0 port link-type trunk port trunk allow-pass vlan 1002 # bgp 65420 router-id 20.20.20.20 peer 2003::2 as-number 100 peer 2004::2 as-number 100 # ipv6-family unicast undo synchronization import-route direct peer 2003::2 enable peer 2004::2 enable # return