Example: Configuring DDNS with PeanutHull server
Network configuration
As shown in Figure 53, the switch is a Web server with domain name whatever.gicp.cn and uses an IP address dynamically obtained through DHCP. To make sure the switch can always provide Web services at whatever.gicp.cn when its IP address changes, perform the following tasks on the switch:
Configure a DDNS policy to update the switch's domain name-to-IP address mapping on the DDNS server. The DDNS server then updates the mapping on the DNS server.
Specify the IP address of the DNS server so that the switch can access the DDNS server through domain name.
Figure 53: Network diagram
Procedure
IMPORTANT: By default, interfaces on the device are disabled (in ADM or Administratively Down state). To have an interface operate, you must use the undo shutdown command to enable that interface. | ||
Before configuring DDNS on the switch, perform the following tasks:
Register with username steven and password nevets at http://www.oray.cn/.
Configure a DDNS policy to update the mapping between the switch's FQDN and IP address.
Make sure the devices can reach each other.
# Create a DDNS policy named oray.cn and enter its view.
<Switch> system-view [Switch] ddns policy oray.cn
# Specify the URL address, username, and password for DDNS update requests.
[Switch-ddns-policy-oray.cn] url oray://phservice2.oray.net [Switch-ddns-policy-oray.cn] username steven [Switch-ddns-policy-oray.cn] password simple nevets
# Set the DDNS update request interval to 12 minutes.
[Switch-ddns-policy-oray.cn] interval 0 0 12 [Switch-ddns-policy-oray.cn] quit
# Specify the IP address of the DNS server as 1.1.1.1.
[Switch] dns server 1.1.1.1
# Apply DDNS policy oray.cn to VLAN-interface 2 to enable DDNS update. The mapping between domain name whatever.gicp.cn and the primary IP address of VLAN-interface 2 will be dynamically updated.
[Switch] interface vlan-interface 2 [Switch-Vlan-interface2] ddns apply policy oray.cn fqdn whatever.gicp.cn
Verifying the configuration
Verify that the switch can update its domain name-IP mapping through the Peanuthull DDNS provider when its IP address changes. The Internet users can resolve the correct IP address through the domain name whatever.gicp.cn to access the Web service.