配置思路
采用如下思路配置DHCPv6 Relay支持VXLAN:
- 配置VXLAN隧道。
- 配置DHCPv6 Relay。
- 在Device2的VBDIF10上使能DHCPv6中继功能。
- 在Device2的VBDIF10上指定DHCPv6服务器地址。
- 在Device2的VBDIF10上插入vss-control选项以及指定中继报文的源IP地址。
- 配置DHCPv6 Server。
数据准备
为完成此配置示例,需准备如下的数据:
- 网络中设备互连的接口IP地址。
- VM1所属的VLAN ID是VLAN 10,VM2所属的VLAN ID是VLAN 20。
- 广播域BD ID是BD 10。
- VXLAN网络标识VNI ID是VNI 5010。
- EVPN实例的RD值为10:1、10:2和10:3,RT值为100:5010。
- L3VPN实例的RD值是20:2,RT值是100:2。
配置路由协议
分别配置Device1、Device2和Device3各接口IP地址。配置OSPF时,注意需要发布32位Loopback接口地址。
# 配置Device1
<HUAWEI> system-view
[~HUAWEI] sysname Device1
[*HUAWEI] commit
[~Device1] interface loopback 1
[*Device1-LoopBack1] ip address 2.2.2.2 32
[*Device1-LoopBack1] quit
[*Device1] interface 10ge 1/0/1
[*Device1-10GE1/0/1] undo portswitch
[*Device1-10GE1/0/1] ip address 192.168.1.1 24
[*Device1-10GE1/0/1] quit
[*Device1] ospf
[*Device1-ospf-1] area 0
[*Device1-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[*Device1-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*Device1-ospf-1-area-0.0.0.0] quit
[*Device1-ospf-1] quit
[*Device1] commit
Device2、Device3的配置与Device1配置类似,这里不再赘述。具体配置过程略
OSPF成功配置后,Device之间可通过OSPF协议发现对方的Loopback接口的IP地址,并能互相ping通。
配置VXLAN隧道模式并使能VXLAN的ACL扩展功能(仅安装了A系列单板的CE16800需要配置此步骤)
配置Device1。Device2、Device3配置与Device1类似,这里不再赘述。
[~Device1] ip tunnel mode vxlan
[*Device1] assign forward nvo3 acl extend enable
[*Device1] commit
配置VXLAN隧道模式、使能VXLAN的ACL扩展功能后,需要保存配置并重启设备才能生效,您可以选择立即重启或完成所有配置后再重启。
分别在Device1、Device3上配置业务接入点
# 配置Device1
[~Device1] bridge-domain 10
[*Device1-bd10] quit
[*Device1] interface 10GE1/0/2.1 mode l2
[*Device1-10GE1/0/2.1] encapsulation dot1q vid 10
[*Device1-10GE1/0/2.1] bridge-domain 10
[*Device1-10GE1/0/2.1] quit
[*Device1] commit
Device3的配置与Device1配置类似,这里不再赘述。
分别在Device1、Device2、Device3上使能EVPN作VXLAN控制平面功能
配置Device1
[~Device1] evpn-overlay enable
[*Device1] commit
Device2、Device3的配置与Device1配置类似,这里不再赘述。
配置BGP EVPN对等体关系
配置Device1
[~Device1] bgp 100
[*Device1-bgp] peer 3.3.3.3 as-number 100
[*Device1-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*Device1-bgp] peer 4.4.4.4 as-number 100
[*Device1-bgp] peer 4.4.4.4 connect-interface LoopBack1
[*Device1-bgp] l2vpn-family evpn
[*Device1-bgp-af-evpn] peer 3.3.3.3 enable
Warning: This operation will reset the peer session. Continue? [Y/N]: y
[*Device1-bgp-af-evpn] peer 4.4.4.4 enable
Warning: This operation will reset the peer session. Continue? [Y/N]: y
[*Device1-bgp-af-evpn] quit
[*Device1-bgp] quit
[*Device1] commit
Device2、Device3的配置与Device1配置类似,这里不再赘述。
分别在Device1、Device2和Device3上配置EVPN实例
配置Device1
[~Device1] bridge-domain 10
[~Device1-bd10] vxlan vni 5010
[*Device1-bd10] evpn
[*Device1-bd10-evpn] route-distinguisher 10:1
[*Device1-bd10-evpn] vpn-target 100:5010
[*Device1-bd10-evpn] quit
[*Device1-bd10] quit
[*Device1] commit
Device2和Device3的配置与Device1配置类似,这里不再赘述。
配置头端复制功能
配置Device1
[~Device1] interface nve 1
[*Device1-Nve1] source 2.2.2.2
[*Device1-Nve1] vni 5010 head-end peer-list protocol bgp
[*Device1-Nve1] quit
[*Device1] commit
Device2和Device3的配置与Device1配置类似,这里不再赘述。
在Device2上配置L3VPN实例
[~Device2] ip vpn-instance vpn1
[*Device2-vpn-instance-vpn1] ipv6-family
[*Device2-vpn-instance-vpn1-af-ipv6] route-distinguisher 20:2
[*Device2-vpn-instance-vpn1-af-ipv6] vpn-target 100:2
[*Device2-vpn-instance-vpn1-af-ipv6] commit
[~Device2-vpn-instance-vpn1-af-ipv6] quit
[~Device2-vpn-instance-vpn1] quit
在Device2上配置VXLAN三层网关
[~Device2] interface vbdif 10
[*Device2-Vbdif10] ip binding vpn-instance vpn1
[*Device2-Vbdif10] ipv6 enable
[*Device2-Vbdif10] ipv6 address fc00:1::1 96
[*Device2-Vbdif10] quit
[*Device2] commit
检查配置结果
上述配置成功后,执行display vxlan tunnel命令可查看到VXLAN隧道的信息;在Device1、Device2、Device3上执行display vxlan vni命令可查看到VNI的状态是Up。以Device2显示为例。
[~Device2] display vxlan tunnel
在Device2上配置DHCPv6 Relay。
[~Device2] dhcpv6 enable
[*Device2] interface Vbdif10
[*Device2-Vbdif10] dhcpv6 relay destination fc00:2::2 public-net
[*Device2-Vbdif10] dhcpv6 vss-control insert enable
[*Device2-Vbdif10] dhcpv6 relay source-ip-address fc00:2::1
[*Device2-Vbdif10] commit
Device1的配置文件
sysname Device1
#
assign forward nvo3 acl extend enable //仅安装了A系列单板的CE16800需要配置此步骤
#
evpn-overlay enable
#
bridge-domain 10
vxlan vni 5010
evpn
route-distinguisher 10:1
vpn-target 100:5010 export-extcommunity
vpn-target 100:5010 import-extcommunity
#
interface 10GE1/0/1
undo portswitch
ip address 192.168.1.1 255.255.255.0
#
interface 10GE1/0/2.1 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
interface Nve1
source 2.2.2.2
vni 5010 head-end peer-list protocol bgp
#
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack1
#
ipv4-family unicast
peer 3.3.3.3 enable
peer 4.4.4.4 enable
#
l2vpn-family evpn
policy vpn-target
peer 3.3.3.3 enable
peer 4.4.4.4 enable
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
Device2的配置文件
sysname Device2
#
assign forward nvo3 acl extend enable //仅安装了A系列单板的CE16800需要配置此步骤
#
dhcpv6 enable
#
evpn-overlay enable
#
ip vpn-instance vpn1
ipv6-family
route-distinguisher 20:2
vpn-target 100:2 export-extcommunity
vpn-target 100:2 import-extcommunity
#
bridge-domain 10
vxlan vni 5010
evpn
route-distinguisher 10:2
vpn-target 100:5010 export-extcommunity
vpn-target 100:5010 import-extcommunity
#
interface Vbdif10
ip binding vpn-instance vpn1
ipv6 enable
ipv6 address FC00:1::1/96
dhcpv6 vss-control insert enable
dhcpv6 relay destination FC00:2::2 public-net
dhcpv6 relay source-ip-address FC00:2::1
#
interface 10GE1/0/1
undo portswitch
ip address 192.168.1.2 255.255.255.0
#
interface 10GE1/0/2
undo portswitch
ip address 192.168.2.1 255.255.255.0
#
interface 10GE1/0/3
undo portswitch
ipv6 enable
ipv6 address FC00:2::1 96
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
interface Nve1
source 3.3.3.3
vni 5010 head-end peer-list protocol bgp
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack1
#
ipv4-family unicast
peer 2.2.2.2 enable
peer 4.4.4.4 enable
#
l2vpn-family evpn
policy vpn-target
peer 2.2.2.2 enable
peer 4.4.4.4 enable
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
return
Device3的配置文件
sysname Device3
#
assign forward nvo3 acl extend enable //仅安装了A系列单板的CE16800需要配置此步骤
#
evpn-overlay enable
#
bridge-domain 10
vxlan vni 5010
evpn
route-distinguisher 10:3
vpn-target 100:5010 export-extcommunity
vpn-target 100:5010 import-extcommunity
#
interface 10GE1/0/1
undo portswitch
ip address 192.168.2.2 255.255.255.0
#
interface 10GE1/0/2.1 mode l2
encapsulation dot1q vid 20
bridge-domain 10
#
interface LoopBack1
ip address 4.4.4.4 255.255.255.255
#
interface Nve1
source 4.4.4.4
vni 5010 head-end peer-list protocol bgp
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
#
ipv4-family unicast
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
l2vpn-family evpn
policy vpn-target
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 192.168.2.0 0.0.0.255