< Home

CLI: Example for Configuring Single-Server Smart DNS in Round Robin Mode

This section provides an example for configuring single-server smart DNS in round robin mode.

Networking Requirements

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.

Figure 1 Round robin-based single-server smart DNS networking

Configuration Roadmap

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:

  1. Enable smart DNS.

  2. Configure round robin-based single-server smart DNS.

  3. Configure NAT Server.
    • Configure a NAT Server mapping for the FW to translate ISP1 public IP addresses 1.1.1.9 and 1.1.1.10 to the private IP address 10.1.1.10 of the web server, so that ISP1 users can access the web server using the public IP addresses.
  4. Configure sticky load balancing.

Procedure

  1. Configure smart DNS.

    # 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

  2. Configure NAT Server mappings.

    [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

  3. Set network parameters for GigabitEthernet 0/0/1 and enable sticky load balancing.

    [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

Configuration Verification

  1. 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.

Configuration Scripts

#
 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >