This section provides an example for configuring single-server smart DNS in round robin mode.
On the enterprise network shown in Figure 1, a web server with the domain name www.example.com is deployed to provide services for Internet users. The private address of the server is 10.1.1.10, and the public address is 2.2.2.10. The DNS server has the mapping between the domain name www.example.com and the public address 2.2.2.10.
The enterprise requires that when ISP1 users access www.example.com, the domain name be resolved to the public address 2.2.2.10 of the web server, the access traffic be transmitted over the ISP1 network to the FW, and the FW use the NAT Server function to map the public address to the private address 10.1.1.10 of the web server.
As shown in Figure 1, you can configure round robin-based smart DNS to enable the FW to allocate addresses to users based on weights. The FW changes the destination addresses of user access requests to divert traffic to web servers over various links, implementing load balancing. The configuration roadmap is as follows:
Enable smart DNS.
Configure round robin-based single-server smart DNS.
Configure sticky load balancing.
# Enable smart DNS.
<FW> system-view [FW] dns-smart enable
# Select a traffic allocation mode.
[FW] dns-smart group 1 type single [FW-dns-smart-group-1] real-server-ip 2.2.2.10 [FW-dns-smart-group-1] metric roundrobin [FW-dns-smart-group-1] weight-rule roundrobin 1.1.1.9 1.1.1.10
# Configure smart DNS mappings.
[FW-dns-smart-group-1] out-interface GigabitEthernet 0/0/1 map weight-rule [FW-dns-smart-group-1] quit
[FW] nat server isp1_server_nat1 protocol tcp global 1.1.1.9 inside 10.1.1.10 no-reverse [FW] nat server isp1_server_nat2 protocol tcp global 1.1.1.10 inside 10.1.1.10 no-reverse
[FW] interface GigabitEthernet 0/0/1 [FW-GigabitEthernet0/0/1] ip address 1.1.1.2 24 [FW-GigabitEthernet0/0/1] gateway 1.1.1.1 [FW-GigabitEthernet0/0/1] redirect-reverse next-hop 1.1.1.1 [FW-GigabitEthernet0/0/1] quit
Ping www.example.com from the PC of an ISP1 user. The returned server address is 1.1.1.9 or 1.1.1.10.
# nat server isp1_server_nat1 global 1.1.1.9 inside 10.1.1.10 no-reverse nat server isp1_server_nat2 global 1.1.1.10 inside 10.1.1.10 no-reverse # dns-smart enable # interface GigabitEthernet 0/0/1 ip address 1.1.1.2 255.255.255.0 redirect-reverse next-hop 1.1.1.1 gateway 1.1.1.1 # dns-smart group 1 type single real-server-ip 2.2.2.10 weight-rule roundrobin 1.1.1.9 1.1.1.10 metric roundrobin out-interface GigabitEthernet 0/0/1 map weight-rule # return