配置VLAN内ND代理示例
配置ND任意代理功能,实现处在相同的VLAN和相同的网段,但是VLAN内配置了用户隔离的设备间的互通。
组网需求
如果主机属于相同的VLAN,但VLAN内配置了二层端口隔离,此时主机间要互通,则需要在关联VLAN的接口上启用VLAN内ND代理功能。
如图13-14所示,Device下有HostA和HostB两个用户。连接HostA和HostB的两个接口属于同一个Sub-VLAN,并且已经配置了二层端口隔离,使HostA和HostB不能直接二层互通。当HostA与HostB之前存在互通需求时,可以在Device上使能VLAN内ND代理功能。
配置思路
采用如下的思路配置VLAN内ND代理功能:
创建和配置Super-VLAN和Sub-VLAN。
将接口加入到Sub-VLAN中。
创建Super-VLAN的VLANIF接口并配置其IPv6地址。
在Super-VLAN的VLANIF接口上使能VLAN内ND代理功能。
操作步骤
- 配置Super-VLAN和Sub-VLAN
# 配置Sub-VLAN。
<HUAWEI> system-view
[~HUAWEI] sysname Device
[*HUAWEI] commit
[~Device] vlan 2
[*Device-vlan2] commit
[~Device-vlan2] quit
# 将接口加入到Sub-VLAN。
[~Device] interface gigabitethernet 0/1/1
[~Device-GigabitEthernet0/1/1] portswitch
[*Device-GigabitEthernet0/1/1] port default vlan 2
[*Device-GigabitEthernet0/1/1] port isolate-state enable vlan 2
[*Device-GigabitEthernet0/1/1] quit
[*Device] interface gigabitethernet 0/1/2
[*Device-GigabitEthernet0/1/2] portswitch
[*Device-GigabitEthernet0/1/2] port default vlan 2
[*Device-GigabitEthernet0/1/2] port isolate-state enable vlan 2
[*Device-GigabitEthernet0/1/2] quit
[*Device] commit
# 配置Super-VLAN,并将Sub-VLAN加入到Super-VLAN中。
[~Device] vlan 3
[*Device-vlan3] aggregate-vlan
[*Device-vlan3] access-vlan 2
[*Device-vlan3] quit
[*Device] commit
- 创建和配置VLANIF接口
# 创建接口VLANIF 3。
[~Device] interface Vlanif 3
# 配置接口VLANIF 3的IPv6地址。
[*Device-Vlanif3] ipv6 enable
[*Device-Vlanif3] ipv6 address 2001:db8:300:400::4 64
- 在VLANIF接口上使能VLAN内ND代理功能
[*Device-Vlanif3] ipv6 nd proxy inner-access-vlan enable
[*Device-Vlanif3] commit
- 配置Host的IPv6地址
# 配置HostA的IPv6地址为2001:db8:300:400::1/64。
# 配置HostB的IPv6地址为2001:db8:300:400::3/64。
- 验证配置结果
配置完成后,HostA和HostB之间可以互相Ping通。
配置文件
Device的配置文件
# sysname Device # vlan batch 2 to 3 # vlan 3 aggregate-vlan access-vlan 2 # interface Vlanif3 ipv6 enable ipv6 address 2001:DB8:300:400::4/64 ipv6 nd proxy inner-access-vlan enable # interface GigabitEthernet0/1/1 portswitch port default vlan 2 port isolate-state enable vlan 2 # interface GigabitEthernet0/1/2 portswitch port default vlan 2 port isolate-state enable vlan 2 # return