As shown in Figure 1, Switch functions as the IPv6 DNS client and works jointly with the IPv6 DNS server. The customer wants Switch to access the server with the IPv6 address fc00:2::1/64 based on the domain name huawei.com.
The configuration roadmap is as follows:
Enable the IPv6 function on Switch and configure IPv6 addresses for VLANIF interfaces to ensure that Switch can communicate with the server and IPv6 DNS server.
Configure dynamic DNS on Switch to enable Switch to access the IPv6 DNS server by querying dynamic DNS entries.
Configure domain name suffixes on Switch so that Switch can add a suffix to the domain name entered by a user and parse the domain name.
# Enable the IPv6 forwarding capability on Switch.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] ipv6
# Add interfaces to VLANs, create VLANIF interfaces, configure IPv6 addresses for the VLANIF interfaces.
[Switch] vlan batch 100 101 [Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type hybrid [Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 100 [Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100 [Switch-GigabitEthernet0/0/1] quit [Switch] interface vlanif 100 [Switch-Vlanif100] ipv6 enable [Switch-Vlanif100] ipv6 address fc00:2::2/64 [Switch-Vlanif100] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port link-type hybrid [Switch-GigabitEthernet0/0/2] port hybrid pvid vlan 101 [Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 101 [Switch-GigabitEthernet0/0/2] quit [Switch] interface vlanif 101 [Switch-Vlanif101] ipv6 enable [Switch-Vlanif101] ipv6 address fc00:3::1/64 [Switch-Vlanif101] quit
# Enable the DNS resolution function.
[Switch] dns resolve
# Configure an IPv6 address for the IPv6 DNS server.
[Switch] dns server ipv6 fc00:3::2
# Set the domain name suffix to ".com".
[Switch] dns domain com [Switch] quit
# Run the ping ipv6 huawei.com command on Switch. The ping operation succeeds, and the destination IPv6 address is fc00:2::1.
<Switch> ping ipv6 huawei.com Resolved Host ( huawei.com -> FC00:2::1 ) PING huawei.com : 56 data bytes, press CTRL_C to break Reply from FC00:2::1 bytes=56 Sequence=1 hop limit=64 time = 3 ms Reply from FC00:2::1 bytes=56 Sequence=2 hop limit=64 time = 4 ms Reply from FC00:2::1 bytes=56 Sequence=3 hop limit=64 time = 2 ms Reply from FC00:2::1 bytes=56 Sequence=4 hop limit=64 time = 3 ms Reply from FC00:2::1 bytes=56 Sequence=5 hop limit=64 time = 3 ms --- huawei.com ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/3/4 ms
# Run the ping ipv6 huawei on Switch. The ping operation succeeds. Switch automatically adds the suffix ".com" to the domain name "huawei" and parses out the destination address fc00:2::1.
<Switch> ping ipv6 huawei Resolved Host ( huawei.com -> FC00:2::1 ) PING huawei.com : 56 data bytes, press CTRL_C to break Reply from FC00:2::1 bytes=56 Sequence=1 hop limit=64 time = 6 ms Reply from FC00:2::1 bytes=56 Sequence=2 hop limit=64 time = 4 ms Reply from FC00:2::1 bytes=56 Sequence=3 hop limit=64 time = 4 ms Reply from FC00:2::1 bytes=56 Sequence=4 hop limit=64 time = 3 ms Reply from FC00:2::1 bytes=56 Sequence=5 hop limit=64 time = 3 ms --- huawei.com ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/4/6 ms
# Run the display dns ipv6 dynamic-host command on Switch. You can view information about IPv6 dynamic DNS entries in the dynamic cache.
<Switch> display dns ipv6 dynamic-host No Domain-name Ipv6address TTL 1 huawei.com FC00:2::1 3579
Switch configuration file
# sysname Switch # ipv6 # dns resolve dns server ipv6 FC00:3::2 dns domain com # vlan batch 100 101 # interface Vlanif100 ipv6 enable ipv6 address FC00:2::2/64 # interface Vlanif101 ipv6 enable ipv6 address FC00:3::1/64 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 101 port hybrid untagged vlan 101 # return