配置路由式ND代理示例
配置路由式ND代理功能,实现处在相同的网段却不在同一物理网络并且连接主机的网关设备具有不同的网关地址的设备间的互通。
组网需求
如果主机属于同一网段却不在同一物理网络上并且连接主机的网关设备具有不同的网关地址,此时主机间要互通,则需要在路由器连接主机的接口上启用路由式ND代理功能。
操作步骤
- 配置接口的IPv6地址
# 配置DeviceA。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/1
[~DeviceA-GigabitEthernet0/1/1] ipv6 enable
[*DeviceA-GigabitEthernet0/1/1] ipv6 address 2001:db8:300:400::2 64
[*DeviceA-GigabitEthernet0/1/1] quit
[*DeviceA] interface gigabitethernet 0/1/2
[*DeviceA-GigabitEthernet0/1/2] ipv6 enable
[*DeviceA-GigabitEthernet0/1/2] ipv6 address 2001:db8:300:600::1 64
[*DeviceA-GigabitEthernet0/1/2] quit
[*DeviceA] commit
# 配置DeviceB。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/1
[~DeviceB-GigabitEthernet0/1/1] ipv6 enable
[*DeviceB-GigabitEthernet0/1/1] ipv6 address 2001:db8:300:600::2 64
[*DeviceB-GigabitEthernet0/1/1] quit
[*DeviceB] interface gigabitethernet 0/1/2
[*DeviceB-GigabitEthernet0/1/2] ipv6 enable
[*DeviceB-GigabitEthernet0/1/2] ipv6 address 2001:db8:300:500::2 64
[*DeviceB-GigabitEthernet0/1/2] quit
[*DeviceB] commit
- 配置IGP路由协议,实现路由互通,本示例采用了OSPFv3路由协议
# 配置DeviceA。
[~DeviceA] ospfv3 1
[*DeviceA-ospfv3-1] router-id 1.1.1.1
[*DeviceA-ospfv3-1] area 0
[*DeviceA-ospfv3-1-area-0.0.0.0] quit
[*DeviceA-ospfv3-1] quit
[*DeviceA] interface gigabitethernet 0/1/1
[*DeviceA-GigabitEthernet0/1/1] ospfv3 1 area 0
[*DeviceA-GigabitEthernet0/1/1] quit
[*DeviceA] interface gigabitethernet 0/1/2
[*DeviceA-GigabitEthernet0/1/2] ospfv3 1 area 0
[*DeviceA-GigabitEthernet0/1/2] quit
[*DeviceA] commit
# 配置DeviceB。
[~DeviceB] ospfv3 1
[*DeviceB-ospfv3-1] router-id 2.2.2.2
[*DeviceB-ospfv3-1] area 0
[*DeviceB-ospfv3-1-area-0.0.0.0] quit
[*DeviceB-ospfv3-1] quit
[*DeviceB] interface gigabitethernet 0/1/1
[*DeviceB-GigabitEthernet0/1/1] ospfv3 1 area 0
[*DeviceB-GigabitEthernet0/1/1] quit
[*DeviceB] interface gigabitethernet 0/1/2
[*DeviceB-GigabitEthernet0/1/2] ospfv3 1 area 0
[*DeviceB-GigabitEthernet0/1/2] quit
[*DeviceB] commit
- 在接口上使能路由式ND代理功能
# 配置DeviceA。
[~DeviceA] interface gigabitethernet 0/1/1
[~DeviceA-GigabitEthernet0/1/1] ipv6 nd proxy route enable
[*DeviceA-GigabitEthernet0/1/1] quit
[*DeviceA] commit
# 配置DeviceB。
[~DeviceB] interface gigabitethernet 0/1/2
[~DeviceB-GigabitEthernet0/1/2] ipv6 nd proxy route enable
[*DeviceB-GigabitEthernet0/1/2] quit
[*DeviceB] commit
- 配置Host的IPv6地址
# 配置HostA的IPv6地址为2001:db8:300:400::1/48。
# 配置HostB的IPv6地址为2001:db8:300:500::1/48。
- 检查配置结果
配置完成后,HostA与HostB之间可以互相Ping通。
配置文件
DeviceA的配置文件
# sysname DeviceA # ospfv3 1 router-id 1.1.1.1 area 0.0.0.0 # interface GigabitEthernet0/1/1 undo shutdown ipv6 enable ipv6 address 2001:DB8:300:400::2/64 ospfv3 1 area 0.0.0.0 ipv6 nd proxy route enable # interface GigabitEthernet0/1/2 undo shutdown ipv6 enable ipv6 address 2001:DB8:300:600::1/64 ospfv3 1 area 0.0.0.0 # return
DeviceB的配置文件
# sysname DeviceB # ospfv3 1 router-id 2.2.2.2 area 0.0.0.0 # interface GigabitEthernet0/1/1 undo shutdown ipv6 enable ipv6 address 2001:DB8:300:600::2/64 ospfv3 1 area 0.0.0.0 # interface GigabitEthernet0/1/2 undo shutdown ipv6 enable ipv6 address 2001:DB8:300:500::2/64 ospfv3 1 area 0.0.0.0 ipv6 nd proxy route enable # return