< Home

Web: Example for Configuring Destination NAT for Internet Users to Access Intranet Servers (One-to-one Mappings Between Public and Private Interfaces)

This section provides an example for configuring destination NAT for Internet users to access intranet servers.

Networking Requirements

An enterprise has deployed a FW as a security gateway on the intranet border. Destination NAT is configured on the FW for the intranet File Transfer Protocol (FTP) servers to provide services for Internet users. The enterprise is allocated a public address 1.1.10.10 by an Internet service provider (ISP). In addition to the IP addresses of Internet interfaces, the enterprise applies for another public IP address (1.1.10.10) for the intranet server to provide services. Figure 1 illustrates the static mapping networking. The router is an access gateway on the ISP network.

Figure 1 Networking diagram for configuring destination NAT

Data Planning

Item

Data

Description

GigabitEthernet 0/0/1

IP address: 1.1.1.1/24

Security zone: Untrust

1.1.1.1/24 is a public address provided by the ISP.

GigabitEthernet 0/0/2

IP address: 10.2.0.1/24

Security zone: DMZ

Intranet servers use 10.2.0.1 as the default gateway address.

Destination NAT

Destination address pool: 10.2.0.7 to 10.2.0.8

When an Internet user accesses address 1.1.10.10, the FW that has the destination NAT function enabled can send traffic to the intranet server.

Routing information

Default route

Destination address: 0.0.0.0

Next hop address: 1.1.1.254

Configure a default route defined for the ISP router on the FW to direct intranet traffic to the router.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Assign IP addresses to interfaces, add the interfaces to security zones, and configure network connectivity.
  2. Configure a security policy for traffic between Internet users and intranet servers.
  3. Configure the destination NAT function so that when an Internet user accesses address 1.1.10.10‏, the FW can send traffic to the intranet server.
  4. Configure a default route on the FW to direct intranet traffic to the ISP router.
  5. Configure a blackhole route on the FW to prevent routing loops between the FW and router.
  6. Configure static routes destined for public addresses of intranet servers on the router.

Procedure

  1. Set IP addresses for interfaces on the FW and assign the interfaces to security zones.
    1. Set the IP address of GigabitEthernet 0/0/1 and assign the interface to a security zone.

      1. Choose Network > Interface.

      2. In Interface List, click of GigabitEthernet 0/0/1 and set the parameters as follows:

        Zone

        untrust

        IPv4

        IP Address

        1.1.1.1/24

      3. Click OK.

    2. Set the IP address of GigabitEthernet 0/0/2 and assign the interface to a security zone.

      1. In Interface List, click of GigabitEthernet 0/0/2 and set the parameters as follows:

        Zone

        dmz

        IPv4

        IP Address

        10.2.0.1/24

      2. Click OK.

  2. Configure a security policy for traffic between Internet users and intranet servers.

    1. Choose Policy > Security Policy > Security Policy.

    2. In Security Policy List, click Add, select Add Security Policy, and configure a security policy based on the following parameter values.

      Name

      policy1

      Source Zone

      untrust

      Destination Zone

      dmz

      Destination Address/Region

      10.2.0.0/24

      Action

      Permit

    3. Click OK.

  3. Configure NAT address pools and NAT policies.

    1. Choose Policy > NAT Policy > NAT Policy > Destination Translation Address Pool.

    2. In Destination Translation Address Pool List, click Add and configure a NAT address pool based on the following parameters.

    3. Click OK.

    4. Choose Policy > NAT Policy > NAT Policy.

    5. In NAT Policy List, click Add and configure a NAT policy based on the following parameters.

    6. When configuring Service, right-click the input box in the column where Service resides and choose Add > Add Protocol or Protocol Number from the shortcut menu.

    7. Set a protocol number as follows:

    8. Click OK.

  4. Configure a black-hole route on the FW, so that traffic from intranet servers can be forwarded to the ISP router.
    1. Choose Network > Route > Static Route.
    2. In Static Route List, click Add and configure a black-hole route based on the following parameter values.

      Protocol

      IPv4

      Destination Address/Mask

      1.1.10.10/255.255.255.0

      Next Hop

      NULL0

    3. Click OK.
  5. Enable NAT ALG for FTP.
    1. Choose Policy > ASPF Configuration.

    2. Select FTP.
  6. Configure a default route on the FW, so that traffic from intranet servers can be forwarded to the ISP router.
    1. Choose Network > Route > Static Route.
    2. In Static Route List, click Add and configure a default route based on the following parameter values.

      Protocol

      IPv4

      Destination Address/Mask

      0.0.0.0/0.0.0.0

      Next Hop

      1.1.1.254

    3. Click OK.
  7. On the router, configure a static route, in which the destination address is 1.1.10.10 and the next-hop address is 1.1.1.1. The router directs traffic destined for 1.1.10.10 to the FW based on the static route so that the FW can forward the traffic to the intranet server.

    Contact your ISP administrator to perform this step.

Configuration Scripts

Configuration script for the FW:

#
 sysname FW
#
interface GigabitEthernet0/0/1
 undo shutdown
 ip address 1.1.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
 undo shutdown
 ip address 10.2.0.1 255.255.255.0 
#
firewall zone untrust
 set priority 5
 add interface GigabitEthernet0/0/1
#
firewall zone dmz
 set priority 50
 add interface GigabitEthernet0/0/2
# 
firewall interzone dmz untrust 
 detect ftp 
#
 ip route-static 0.0.0.0 0.0.0.0 1.1.1.254 
 ip route-static 1.1.10.10 255.255.255.255 NULL0 
# 
destination-nat address-group addressgroup1 0
 section 10.2.0.7 10.2.0.8 
#  
security-policy   
  rule name policy1  
    source-zone untrust 
    destination-zone dmz 
    destination-address 10.2.0.0 24 
    action permit 
#  
nat-policy  
  rule name policy_nat1 
    source-zone untrust 
    destination-address 1.1.10.10 32 
    service protocol tcp destination-port  3000 to 3001
    action destination-nat static port-to-address address-group addressgroup1 21
# 
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >