Description:

In certain scenarios it can be necessary, that devices in the local network invoke the IP address of the Internet connection (e.g. via DNS name) and access a server in the local network via portforwarding (Hairpin NAT or NAT reflection).

This article describes how to set up hairpin NAT on a Unified Firewall.

Hairpin NAT only works in stand-alone operation and with a series connection. Hairpin NAT does not work with a layer-3 loop, because the LANCOM router forwards the outgoing packets directly to its WAN interface.


Requirements:



Scenario:

1) The Unified Firewall is directly connected to the Internet


2) The router upstream from the Unified Firewall establishes the Internet connection



Procedure:

The procedure is the same for both scenarios.


1) Setting up the hairpin NAT:

1.1) Open the configuration of the Unified Firewall in a browser.

On the desktop, click the network object (in this example the network INTRANET). In the context menu, select the connection tool and click on the host object for which the port forwarding is set up (in this example the object web server).

1.2) Choose the protocol used by the computer on the local network to access the web server.

1.3) Under Options, click None to make further settings.

1.4) Enter the following parameters:

1.5.) Click on Save.

1.6) Finally, implement the changes by clicking Activate.

1.7) This concludes the configuration of the hairpin NAT.



2) Create an exception rule for the protocols HTTP and HTTPS (only required when using the HTTP proxy)

When using the HTTP proxy the outgoing packets are filtered by the proxy, which means that the hairpin NAT does not work. An exception rule must therefore be created so that the data traffic from the local network to the public IPv4 address bypasses the proxy.

This also applies to the mail proxy and the VoIP proxy. However, it would be unusual to perform SIP registration from the local network via port forwarding.

2.1) Click the icon to create a new host object.

2.2) Modify the following parameters and then click Create:

2.3) Click the network object on the desktop (in this example INTRANET), select the connection tool and click the host object created in step 2.2.

2.4) Add the protocols HTTP and HTTPS.

2.5) For the protocols HTTP and HTTPS, click the “arrow” icon so that the arrow for each one points to the right.

2.6) For HTTP and HTTPS under Options, click None for each one to adjust further settings. 

2.7) For HTTP and HTTPS, set NAT / Masquerading for each one to the option left-to-right and click OK.

  

2.8) Click Create to create the firewall rules.

2.9) Finally, implement the changes on the United Firewall by clicking Activate.