配置Multi-VPN-Instance CE(IPv6)示例
通过在CE上使用OSPF多实例实现局域网不同业务的隔离。
组网需求
CE1和CE2为分公司A和分公司B的CE设备,分别属于vpna和vpnb。
MCE作为VPN多实例交换的设备接入总公司侧的vpna和vpnb的Site。
vpna和vpnb使用不同的VPN-Target属性。
DeviceA和DeviceB分别为总公司内用于与分公司A和分公司B通信的设备。
要求属于相同VPN的用户之间能互相访问,不同VPN的用户之间不能互相访问。
配置注意事项
在配置过程中,需注意以下事项:
MCE上需要配置不同的VPN实例,并分别绑定不同的接口。
本例中PE与MCE间通过配置OSPFv3多实例进程来交互路由,因此需要在MCE上配置不对路由环路进行检查。
配置思路
采用如下思路配置Multi-VPN-Instance CE:
PE与PE之间配置OSPF实现PE之间的互通、配置MP-IBGP交换VPN路由信息。
PE与相连的CE之间建立BGP4+对等体,把VPN路由引入PE的VPN路由表中。
MCE与PE2之间配置OSPFv3多实例,交换VPN路由信息。
MCE与DeviceA、DeviceB之间配置RIPng交换VPN路由信息。
MCE与PE2之间配置OSPFv3多实例时需进行以下配置。
在PE2的OSPFv3视图下(该OSPFv3进程是指在MCE与PE2之间配置OSPFv3多实例时所使用的OSPFv3进程)引入BGP路由,发布PE1的私网路由给MCE。
在PE2的BGP-VPN实例IPv6地址族视图下引入该OSPFv3进程(也是指在MCE与PE2之间配置OSPFv3多实例时所使用的OSPFv3进程),发布MCE的私网路由信息给PE1上。
数据准备
为完成此配置例,需准备如下的数据:
在PE1、PE2及MCE上为每个相互隔离的业务创建VPN实例vpna和vpnb,vpna的出方向和入方向的VPN-Target值为111:1,vpnb的出方向和入方向的VPN-Target值为222:2
配置OSPFv3所需数据(为不同业务配置OSPF多实例时所使用的OSPF进程号应互不相同),vpna的OSPFv3多实例进程号为100,vpnb的OSPFv3多实例进程号为200
在MCE上为引入Site3、Site4的VPN路由所使用的RIPng进程,vpna的RIPng多实例进程号为100,vpnb的RIPng多实例进程号为200
操作步骤
- 在骨干网的PE上配置OSPF协议,实现PE之间的互通
具体配置过程请参见后面的配置文件。
完成此步配置后,PE之间应能互相学习到对方的Loopback1的地址。
以PE2为例:
<PE2> display ip routing-table
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table : _public_ Destinations : 9 Routes : 9 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 OSPF 10 1 D 172.16.1.1 GigabitEthernet1/0/0 2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack1 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.1.0/24 Direct 0 0 D 172.16.1.2 GigabitEthernet1/0/0 172.16.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0 172.16.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- 在骨干网的PE上配置MPLS基本能力和MPLS LDP,PE之间建立LDP LSP
具体配置过程请参见后面的配置文件。
完成此步配置后,在PE上执行命令display mpls ldp session,应能看见PE之间的MPLS LDP会话状态为“Operational”。
以PE2为例:
<PE2> display mpls ldp session
LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM) An asterisk (*) before a session means the session is being deleted. -------------------------------------------------------------------------- PeerID Status LAM SsnRole SsnAge KASent/Rcv -------------------------------------------------------------------------- 1.1.1.1:0 Operational DU Active 0000:00:07 32/32 -------------------------------------------------------------------------- TOTAL: 1 Session(s) Found.
- 在PE设备上配置VPN实例,将CE1、CE2接入PE1,将MCE接入PE2
# 配置PE1。
<PE1> system-view
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv6-family
[*PE1-vpn-instance-vpna-af-ipv6] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 111:1 both
[*PE1-vpn-instance-vpna-af-ipv6] quit
[*PE1-vpn-instance-vpna] quit
[*PE1] ip vpn-instance vpnb
[*PE1-vpn-instance-vpnb] ipv6-family
[*PE1-vpn-instance-vpnb-af-ipv6] route-distinguisher 100:2
[*PE1-vpn-instance-vpnb-af-ipv6] vpn-target 222:2 both
[*PE1-vpn-instance-vpnb-af-ipv6] quit
[*PE1-vpn-instance-vpnb] quit
[*PE1] interface gigabitethernet1/0/0
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ipv6 enable
[*PE1-GigabitEthernet1/0/0] ipv6 address 2001:db8:1::2 64
[*PE1-GigabitEthernet1/0/0] quit
[*PE1] interface gigabitethernet2/0/0
[*PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpnb
[*PE1-GigabitEthernet2/0/0] ipv6 enable
[*PE1-GigabitEthernet2/0/0] ipv6 address 2001:db8:2::2 64
[*PE1-GigabitEthernet2/0/0] quit
[*PE1] commit
# 配置PE2。
<PE2> system-view
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv6-family
[*PE2-vpn-instance-vpna-af-ipv6] route-distinguisher 200:1
[*PE2-vpn-instance-vpna-af-ipv6] vpn-target 111:1 both
[*PE2-vpn-instance-vpna-af-ipv6] quit
[*PE2-vpn-instance-vpna] quit
[*PE2] ip vpn-instance vpnb
[*PE2-vpn-instance-vpnb] ipv6-family
[*PE2-vpn-instance-vpnb-af-ipv6] route-distinguisher 200:2
[*PE2-vpn-instance-vpnb-af-ipv6] vpn-target 222:2 both
[*PE2-vpn-instance-vpnb-af-ipv6] quit
[*PE2-vpn-instance-vpnb] quit
[*PE2] interface gigabitethernet2/0/0
[*PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[*PE2-GigabitEthernet2/0/0] ipv6 enable
[*PE2-GigabitEthernet2/0/0] ipv6 address 2001:db8:8::1 64
[*PE2-GigabitEthernet2/0/0] quit
[*PE2]interface gigabitethernet3/0/0
[*PE2-GigabitEthernet3/0/0] ip binding vpn-instance vpnb
[*PE2-GigabitEthernet3/0/0] ipv6 enable
[*PE2-GigabitEthernet3/0/0] ipv6 address 2001:db8:9::1 64
[*PE2-GigabitEthernet3/0/0] quit
[*PE2] commit
- 在MCE设备上配置VPN实例,将Site3、Site4及PE2接入MCE
<HUAWEI> system-view
[~HUAWEI] sysname MCE
[*HUAWEI] commit
[~MCE] ip vpn-instance vpna
[*MCE-vpn-instance-vpna] ipv6-family
[*MCE-vpn-instance-vpna-af-ipv6] route-distinguisher 100:1
[*MCE-vpn-instance-vpna-af-ipv6] vpn-target 111:1 both
[*MCE-vpn-instance-vpna-af-ipv6] quit
[*MCE-vpn-instance-vpna] quit
[*MCE] ip vpn-instance vpnb
[*MCE-vpn-instance-vpnb] ipv6-family
[*MCE-vpn-instance-vpnb-af-ipv6] route-distinguisher 100:2
[*MCE-vpn-instance-vpnb-af-ipv6] vpn-target 222:2 both
[*MCE-vpn-instance-vpnb-af-ipv6] quit
[*MCE-vpn-instance-vpnb] quit
[*MCE] interface gigabitethernet3/0/0
[*MCE-GigabitEthernet3/0/0] ip binding vpn-instance vpna
[*MCE-GigabitEthernet3/0/0] ipv6 enable
[*MCE-GigabitEthernet3/0/0] ipv6 address 2001:db8:3::2 64
[*MCE-GigabitEthernet3/0/0] quit
[*MCE] interface gigabitethernet4/0/0
[*MCE-GigabitEthernet4/0/0] ip binding vpn-instance vpnb
[*MCE-GigabitEthernet4/0/0] ipv6 enable
[*MCE-GigabitEthernet4/0/0] ipv6 address 2001:db8:4::2 64
[*MCE-GigabitEthernet4/0/0] quit
[*MCE] interface gigabitethernet1/0/0
[*MCE-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*MCE-GigabitEthernet1/0/0] ipv6 enable
[*MCE-GigabitEthernet1/0/0] ipv6 address 2001:db8:8::2 64
[*MCE-GigabitEthernet1/0/0] quit
[*MCE] interface gigabitethernet2/0/0
[*MCE-GigabitEthernet2/0/0] ip binding vpn-instance vpnb
[*MCE-GigabitEthernet2/0/0] ipv6 enable
[*MCE-GigabitEthernet2/0/0] ipv6 address 2001:db8:9::2 64
[*MCE-GigabitEthernet2/0/0] quit
[*MCE] commit
- 在PE之间建立MP-IBGP对等体,在PE1与CE1、CE2之间建立BGP4+对等体
具体配置过程请参见后面的配置文件。
完成此步配置后,在PE1上执行命令display bgp vpnv6 all peer可以看见PE1与PE2的IBGP对等体关系及PE1与CE1、CE2之间建立EBGP对等体关系均为“Established”。
[~PE1] display bgp vpnv6 all peer
BGP local router ID : 172.16.1.1 Local AS number : 100 Total number of peers : 3 Peers in established state : 3 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2.2.2.2 4 100 140 146 0 01:57:45 Established 0 Peer of IPv6-family for vpn instance : VPN-Instance vpna : Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2001:db8:1::1 4 65410 11 334 0 00:05:42 Established 2 VPN-Instance vpnb : Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2001:db8:2::1 4 65420 6 336 0 00:01:37 Established 2
- 在PE2和MCE之间配置OSPF多实例
# 配置PE2。
[~PE2] ospfv3 100 vpn-instance vpna
[*PE2-ospfv3-100] import-route bgp
[*PE2-ospfv3-100] quit
[*PE2] interface GigabitEthernet2/0/0
[*PE2-GigabitEthernet2/0/0] ospfv3 100 area 1 instance 1
[*PE2-GigabitEthernet2/0/0] quit
[*PE2] ospfv3 200 vpn-instance vpnb
[*PE2-ospfv3-100] import-route bgp
[*PE2-ospfv3-100] quit
[*PE2] interface GigabitEthernet3/0/0
[*PE2-GigabitEthernet3/0/0] ospfv3 200 area 2 instance 2
[*PE2-GigabitEthernet3/0/0] quit
[*PE2] bgp 100
[*PE2-bgp] ipv6-family vpn-instance vpna
[*PE2-bgp-6-vpna] import-route ospfv3 100
[*PE2-bgp-6-vpna] quit
[*PE2-bgp] ipv6-family vpn-instance vpnb
[*PE2-bgp-6-vpnb] import-route ospfv3 200
[*PE2-bgp-6-vpnb] quit
[*PE2-bgp] quit
[*PE2] commit
# 配置MCE。
[~MCE] ospfv3 100 vpn-instance vpna
[*MCE-ospfv3-100]quit
[*MCE] interface GigabitEthernet1/0/0
[*MCE-GigabitEthernet1/0/0] ospfv3 100 area 1 instance 1
[*MCE-GigabitEthernet1/0/0] quit
[*MCE] ospf 200 vpn-instance vpnb
[*MCE-ospfv3-200]quit
[*MCE] interface GigabitEthernet2/0/0
[*MCE-GigabitEthernet2/0/0] ospfv3 200 area 2 instance 2
[*MCE-GigabitEthernet2/0/0] quit
[*MCE] commit
- 在MCE上配置不进行环路检查,并引入通往VPN Site的RIPng路由
[~MCE] ospfv3 100 vpn-instance vpna
[*MCE-ospfv3-100] vpn-instance-capability simple
[*MCE-ospfv3-100] import-route ripng 100
[*MCE-ospfv3-100] commit
[*MCE-ospfv3-100] quit
[*MCE] ospfv3 200 vpn-instance vpnb
[*MCE-ospfv3-200] vpn-instance-capability simple
[*MCE-ospfv3-200] import-route ripng 200
[*MCE-ospfv3-200] commit
[~MCE-ospfv3-200] quit
- 在MCE上为引入Site3、Site4的VPN路由配置RIPng
# 配置MCE。
[~MCE] ripng 100 vpn-instance vpna
[*MCE-ripng-100] import-route ospfv3 100
[*MCE-ripng-100] quit
[*MCE] interface GigabitEthernet3/0/0
[*MCE-GigabitEthernet3/0/0] ripng 100 enable
[*MCE-GigabitEthernet3/0/0] quit
[*MCE] ripng 200 vpn-instance vpnb
[*MCE-rip-200] import-route ospf 200
[*MCE-rip-200] quit
[*MCE] interface GigabitEthernet4/0/0
[*MCE-GigabitEthernet4/0/0] ripng 200 enable
[*MCE-GigabitEthernet4/0/0] quit
[*MCE] commit
- 在DeviceA、DeviceB配置RIPng与MCE实现相互通信
# 配置DeviceA。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] ripng 100
[*DeviceA-ripng-100] quit
[*DeviceA] interface GigabitEthernet1/0/0
[*DeviceA-GigabitEthernet1/0/0] ripng 100 enable
[*DeviceA-GigabitEthernet1/0/0] quit
[*DeviceA] interface Loopback 1
[*DeviceA-LoopBack1] ripng 100 enable
[*DeviceA-LoopBack1] quit
[*DeviceA] commit
# 配置DeviceB。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] ripng 200
[*DeviceB-ripng-200] quit
[*DeviceB] interface GigabitEthernet1/0/0
[*DeviceB-GigabitEthernet1/0/0] ripng 200 enable
[*DeviceB-GigabitEthernet1/0/0] quit
[*DeviceB] interface Loopback 1
[*DeviceB-LoopBack1] ripng 200 enable
[*DeviceB-LoopBack1] quit
[*DeviceB] commit
- 检查配置结果
完成上述配置后,在MCE设备上执行命令display ipv6 routing-table vpn-instance命令,可以看到去往对端CE的路由。
以vpna为例:
[~MCE] display ipv6 routing-table vpn-instance vpna
Routing Table : vpna Destinations : 8 Routes : 8 Destination : 2001:db8:11::1 PrefixLength : 128 NextHop : FE80::3A00:10FF:FE03:107 Preference : 150 Cost : 1 Protocol : OSPFv3ASE RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : 2001:db8:13::3 PrefixLength : 128 NextHop : FE80::2200:10FF:FE03:0 Preference : 100 Cost : 1 Protocol : RIPng RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet3/0/0 Flags : D Destination : 2001:db8:8:: PrefixLength : 64 NextHop : 2001:db8:8::2 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : 2001:db8:8::2 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : 2001:db8:1:: PrefixLength : 64 NextHop : FE80::3A00:10FF:FE03:107 Preference : 150 Cost : 1 Protocol : OSPFv3ASE RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : 2001:db8:3:: PrefixLength : 64 NextHop : 2001:db8:3::2 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet3/0/0 Flags : D Destination : 2001:db8:3::2 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet3/0/0 Flags : D Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : D
在PE上执行display ipv6 routing-table vpn-instance命令,可以看到去往对端Site的路由。
以PE1上的vpna为例:
[~PE1] display ipv6 routing-table vpn-instance vpna
Routing Table : vpna Destinations : 7 Routes : 7 Destination : 2001:db8:11::1 PrefixLength : 128 NextHop : 2001:db8:1::1 Preference : 255 Cost : 0 Protocol : EBGP RelayNextHop : 2001:db8:1::1 TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : RD Destination : 2001:db8:13::3 PrefixLength : 128 NextHop : ::FFFF:2.2.2.2 Preference : 255 Cost : 2 Protocol : IBGP RelayNextHop : -- TunnelID : LDP LSP Interface : LDP LSP Flags : RD Destination : 2001:db8:8:: PrefixLength : 64 NextHop : ::FFFF:2.2.2.2 Preference : 255 Cost : 2 Protocol : IBGP RelayNextHop : -- TunnelID : LDP LSP Interface : LDP LSP Flags : RD Destination : 2001:db8:1:: PrefixLength : 64 NextHop : 2001:db8:1::2 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : 2001:db8:1::2 PrefixLength : 128 NextHop : ::1 Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : GigabitEthernet1/0/0 Flags : D Destination : 2001:db8:3:: PrefixLength : 64 NextHop : ::FFFF:2.2.2.2 Preference : 255 Cost : 2 Protocol : IBGP RelayNextHop : -- TunnelID : LDP LSP Interface : LDP LSP Flags : RD Destination : FE80:: PrefixLength : 10 NextHop : :: Preference : 0 Cost : 0 Protocol : Direct RelayNextHop : :: TunnelID : 0x0 Interface : NULL0 Flags : D
CE1、DeviceA之间可以互通,CE2、DeviceB之间可以互通。
以CE1为例:
[~CE1] ping ipv6 -a 2001:db8:11::1 2001:db8:13::3
PING 2001:db8:13::3 : 56 data bytes, press CTRL_C to break Reply from 2001:db8:13::3 bytes=56 Sequence=1 hop limit=61 time=26 ms Reply from 2001:db8:13::3 bytes=56 Sequence=2 hop limit=61 time=2 ms Reply from 2001:db8:13::3 bytes=56 Sequence=3 hop limit=61 time=2 ms Reply from 2001:db8:13::3 bytes=56 Sequence=4 hop limit=61 time=2 ms Reply from 2001:db8:13::3 bytes=56 Sequence=5 hop limit=61 time=123 ms ---2001:db8:13::3 ping statistics--- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max=2/31/123 ms
配置文件
CE1的配置文件
# sysname CE1 # interface GigabitEthernet1/0/0 undo shutdown ipv6 enable ipv6 address 2001:db8:1::1/64 # interface LoopBack1 ipv6 enable ipv6 address 2001:db8:11::1/128 # bgp 65410 router-id 1.1.1.1 peer 2001:db8:1::2 as-number 100 # ipv6-family unicast undo synchronization import-route direct peer 2001:db8:1::2 enable # return
CE2的配置文件
# sysname CE2 # interface GigabitEthernet1/0/0 undo shutdown ipv6 enable ipv6 address 2001:db8:2::1/64 # interface LoopBack1 ipv6 enable ipv6 address 2001:db8:12::2/128 # bgp 65420 router-id 2.2.2.2 peer 2001:db8:2::2 as-number 100 # ipv6-family unicast undo synchronization import-route direct peer 2001:db8:2::2 enable # return
PE1的配置文件
# sysname PE1 # ip vpn-instance vpna ipv6-family route-distinguisher 100:1 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # ip vpn-instance vpnb ipv6-family route-distinguisher 100:2 apply-label per-instance vpn-target 222:2 export-extcommunity vpn-target 222:2 import-extcommunity # mpls lsr-id 1.1.1.1 # mpls # mpls ldp # ipv4-family # interface GigabitEthernet1/0/0 undo shutdown ip binding vpn-instance vpna ipv6 enable ipv6 address 2001:db8:1::2/64 # interface GigabitEthernet2/0/0 undo shutdown ip binding vpn-instance vpnb ipv6 enable ipv6 address 2001:db8:2::2/64 # interface GigabitEthernet3/0/0 undo shutdown ip address 172.16.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 1.1.1.1 255.255.255.255 # 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 vpna peer 2001:db8:1::1 as-number 65410 # ipv6-family vpn-instance vpnb peer 2001:db8:2::1 as-number 65420 # ospf 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 172.16.1.0 0.0.0.255 # return
PE2的配置文件
# sysname PE2 # ip vpn-instance vpna ipv6-family route-distinguisher 200:1 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # ip vpn-instance vpnb ipv6-family route-distinguisher 200:2 apply-label per-instance vpn-target 222:2 export-extcommunity vpn-target 222:2 import-extcommunity # mpls lsr-id 2.2.2.2 # mpls # mpls ldp # ipv4-family # ospfv3 100 vpn-instance vpna router-id 5.5.5.5 import-route bgp area 0.0.0.1 # ospfv3 200 vpn-instance vpnb router-id 6.6.6.6 import-route bgp area 0.0.0.2 # interface GigabitEthernet1/0/0 undo shutdown ip address 172.16.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 undo shutdown ip binding vpn-instance vpna ipv6 enable ipv6 address 2001:db8:8::1/64 ospfv3 100 area 0.0.0.1 instance 1 # interface GigabitEthernet3/0/0 undo shutdown ip binding vpn-instance vpnb ipv6 enable ipv6 address 2001:db8:9::1/64 ospfv3 200 area 0.0.0.2 instance 2 # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 # 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 # ipv4-family vpnv4 policy vpn-target peer 1.1.1.1 enable # ipv6-family vpnv6 policy vpn-target peer 1.1.1.1 enable # ipv6-family vpn-instance vpna import-route ospfv3 100 # ipv6-family vpn-instance vpnb import-route ospfv3 200 # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 172.16.1.0 0.0.0.255 # return
MCE的配置文件
# sysname MCE # ip vpn-instance vpna ipv6-family route-distinguisher 100:1 apply-label per-instance vpn-target 111:1 export-extcommunity vpn-target 111:1 import-extcommunity # ip vpn-instance vpnb ipv6-family route-distinguisher 200:2 apply-label per-instance vpn-target 222:2 export-extcommunity vpn-target 222:2 import-extcommunity # ospfv3 100 vpn-instance vpna router-id 7.7.7.7 vpn-instance-capability simple import-route ripng 100 area 0.0.0.1 # ospfv3 200 vpn-instance vpnb router-id 8.8.8.8 vpn-instance-capability simple import-route ripng 200 area 0.0.0.2 # interface GigabitEthernet1/0/0 undo shutdown ip binding vpn-instance vpna ipv6 enable ipv6 address 2001:db8:8::2/64 ospfv3 100 area 0.0.0.1 instance 1 # interface GigabitEthernet2/0/0 undo shutdown ip binding vpn-instance vpnb ipv6 enable ipv6 address 2001:db8:9::2/64 ospfv3 200 area 0.0.0.2 instance 2 # interface GigabitEthernet3/0/0 undo shutdown ip binding vpn-instance vpna ipv6 enable ipv6 address 2001:db8:3::2/64 ripng 100 enable # interface GigabitEthernet4/0/0 undo shutdown ip binding vpn-instance vpnb ipv6 enable ipv6 address 2001:db8:4::2/64 ripng 200 enable # ripng 100 vpn-instance vpna import-route ospfv3 100 # ripng 200 vpn-instance vpnb import-route ospfv3 200 # return
DeviceA的配置文件
# sysname DeviceA # interface GigabitEthernet1/0/0 undo shutdown ipv6 enable ipv6 address 2001:db8:3::1/64 ripng 100 enable # interface LoopBack1 ipv6 enable ipv6 address 2001:db8:13::3/128 ripng 100 enable # ripng 100 # return
DeviceB的配置文件
# sysname DeviceB # interface GigabitEthernet1/0/0 undo shutdown ipv6 enable ipv6 address 2001:db8:4::1/64 ripng 200 enable # interface LoopBack1 ipv6 enable ipv6 address 2001:db8:14::4/128 ripng 200 enable # ripng 200 # return