SonicOS 7 Rules and Policies

Inbound Port Address Translation via WAN IP Address

This is one of the more complex NAT policies you can create on a firewall running SonicOS/X — it allows you to use the WAN IP address of the firewall to provide access to multiple internal servers. This is most useful in situations where your ISP has only provided a single public IP address, and that IP address has to be used by the firewall’s WAN interface (by default, the X1 interface).

Below, create the programming to provide public access to two internal web servers through the firewall’s WAN IP address; each is tied to a unique custom port. It is possible to create more than two as long as all the ports are unique.

To use the WAN IP address of the firewall to provide access to multiple internal servers

  1. Create two custom service objects for the unique public ports the servers respond on. See Create Services.
  2. Create two address objects for the servers’ private IP addresses. See Create Addresses.
  3. Create two NAT policies to allow the two servers to initiate traffic to the public internet. See Create Outbound NAT Policies.
  4. Create two NAT policies to map the custom ports to the actual listening ports, and to map the private IP addresses to the firewall’s WAN IP address. See Create Inbound NAT Policies.
  5. Create two access rules to allow any public user to connect to both servers via the firewall’s WAN IP address and the servers’ respective unique custom ports. See Create Access Rules.

To create an inbound port address translation policy via WAN IP address

Create Services

  1. Navigate to the OBJECT | Match Objects > Services page.
  2. Click +Add. The Service Objects dialog displays.
  3. Create two Service Objects. For Name, enter your custom service object names, such as servone_public_port and servtwo_public_port.
  4. For each, select TCP(6) as the Protocol.
  5. Enter 9100 as the starting and ending ports for servone_public_port.
  6. Enter 9200 as the starting and ending ports for servtwo_public_port.
  7. After configuring each custom service, click Save to save the custom services.

  8. After configuring both custom services, click Close.

Create Addresses

  1. Navigate to the OBJECT | Match Objects > Addresses page. Create two Address Objects.
  2. Click +Add. The Address Object Settings dialog displays.
  3. For Name, enter your custom address object name, such as servone_private_ip and servtwo_private_ip.
  4. Select the zone that the servers are in from the Zone Assignment drop-down menu.
  5. Choose Host from the Type drop-down menu.
  6. Enter the server’s private IP addresses in the IP Address field.
  7. After configuring each address object, click Save to create the address object.

  8. After configuring both address objects, click Close.

Create Outbound NAT Policies

  1. Navigate to the POLICY | Rules and Policies > NAT Rules page.
  2. Click +Add. The Adding NAT Rule Two_Serversdialog displays.
  3. To create two NAT policies to allow both servers to initiate traffic to the public internet using the firewall’s WAN IP address, configure the two sets of options shown in the Option Choices: Two Servers to Initiate Traffic to the Internet table.

    Option Choices: Two Servers to Initiate Traffic to the Internet
    OptionsServer One ValuesServer Two Values
    Original Sourceservone_private_ipservtwo_private_ip
    Translated SourceWAN Interface IPWAN Interface IP
    Original DestinationAnyAny
    Translated DestinationOriginalOriginal
    Original ServiceAnyAny
    Translated ServiceOriginalOriginal
    Inbound InterfaceX3X3
    Outbound InterfaceX1X1
    CommentEnter a short descriptionEnter a short description
    Enable NAT PolicyCheckedChecked
    Create a reflexive policy(dimmed)(dimmed)
  4. After configuring the NAT policy for each server, click Add to add and activate that NAT policy.

  5. After configuring both NAT policies, click Cancel.

    With these policies in place, the firewall translates the servers’ private IP addresses to the public WAN IP address when it initiates traffic out the WAN interface (by default, the X1 interface).

Create Inbound NAT Policies

  1. Click +Add on the POLICY | Rules and Policies > NAT Rules page again. The Adding NAT Rule dialog displays.
  2. To create two NAT policies to map the custom ports to both servers’ real listening ports and to map the firewall’s WAN IP address to the servers’ private addresses, configure the two sets of options shown in the Option Choices: Mapping Custom Ports to Servers table.

    Option Choices: Mapping Custom Ports to Servers
    OptionsServer One ValuesServer Two Values
    Original SourceAnyAny
    Translated SourceOriginalOriginal
    Original DestinationWAN Interface IPWAN Interface IP
    Translated Destinationservone_private_ipservtwo_private_ip
    Original Serviceservone_public_portservtwo_public_port
    Translated ServiceHTTPHTTP
    Inbound InterfaceX1X1
    Outbound InterfaceAny

    Any

    Make sure you choose Any as the destination interface and not the interface that the server is on.

    CommentEnter a short descriptionEnter a short description
    Enable NAT PolicyCheckedChecked
    Create a reflexive policyClearedCleared
  3. After configuring the NAT policy for each server, click Add to add and activate that NAT policy.

  4. After configuring both NAT policies, click Cancel.

Create Access Rules

  1. Navigate to the POLICY | Rules and Policies > Access Rules page.
  2. Click +Add. The Adding Rule dialog displays.
  3. To create the two access rules that allow anyone from the public Internet to access the two web servers using the custom ports and the firewall’s WAN IP address, configure the two sets of options shown in the Option Choices: Creating Access Rules table.

    Option Choices: Creating Access Rules
    OptionsServer One ValuesServer Two Values
    ActionAllowAllow
    Zone/InterfaceWANWAN
    AddressZone assigned to serverZone assigned to server
    Source Port/ServicesAnyAny
    Serviceservone_public_portservtwo_public_port
    Destination Zone/InterfaceAnyAny
    Destination AddressWAN Interface IPWAN Interface IP
    Users IncludedAllAll
    Users ExcludedNoneNone
    ScheduleAlways onAlways on
    Loggingcheckedchecked
    CommentEnter a short descriptionEnter a short description
  4. After configuring the access rule for each server, click Add to add and activate that access rule.

  5. After configuring both access rules, click Cancel.

Test and Verify

To verify, attempt to access the web servers via the firewall’s WAN IP address using a system located on the public internet on the new custom port (for example: http://67.115.118.70:9100 and http://67.115.118.70:9200). You should be able to successfully connect. If not, review this section and ensure that you have configured all required settings correctly.

Was This Article Helpful?

Help us to improve our support portal

Techdocs Article Helpful form

Techdocs Article NOT Helpful form

  • Still can't find what you're looking for? Try our knowledge base or ask our community for more help.