en-US
search-icon

Knowledge Base

How to Configure NAT over VPN in a Site to Site VPN

Description

A VPN tunnel cannot be established if both the destination network and the local network have the same subnets. The Apply NAT Policies feature or NAT over VPN is configured when both sides of a proposed site to site VPN configuration have identical, and hence overlapping, subnets.

Resolution

Image

In this scenario, a VPN tunnel is created between a SonicWall NSA 2400 and a SonicWall NSA 240, and NAT over VPN tunnel is configured to translate the networks to a different subnet. Site A subnet, 192.168.1.0/24 is translated to a virtual subnet of 172.16.1.0/24 and Site B subnet, 192.168.1.0/24 is translated to a virtual subnet of 172.16.2.0/24.

  • Site A: 192.168.1.0 /24 is mapped to 172.16.1.0 /24
  • Site B: 192.168.1.0 /24 is mapped to 172.16.2.0 /24


Configuring Site A (NSA 2400):

Step  1. Login to the SonicWall Management interface.

Step  2. Navigate to the Network | Address Objects page.
Step  3. Create an Address Object called "Local Translated". This is the NAT'ed network for the local subnet.

  • Name: Local Translated
  • Zone: LAN
  • Network: 172.16.1.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual local subnets)

Step  4. Create an Address Object called "Remote Translated". This is the NAT'ed network for the remote subnet.

  • Name: Remote Translated
  • Zone: VPN
  • Network: 172.16.2.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual remote subnets)

Image

Step  5. Navigate to the VPN | Settings page.
Step  6. Click on Add to create a new Site to Site VPN policy with settings as per the screenshot.

Image

Configuring Site B (NSA 240):

Step  1. Login to the SonicWall Management interface.
Step  2. Navigate to the Network | Address Objects page.
Step  3. Create an Address Object called "Local Translated". This is the NAT'ed network for the local subnet.

  • Name: Local Translated
  • Zone: LAN
  • Network: 172.16.2.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual local subnets)

Step  4. Create an Address Object called "Remote Translated". This is the NAT'ed network for the remote subnet.

  • Name: Remote Translated
  • Zone: VPN
  • Network: 172.16.1.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual remote subnets)

Image 

Step  5. Navigate to the VPN | Settings page.
Step  6. Click on Add to create a new Site to Site VPN policy with settings as per the screenshot.

 

Image 

Once both VPN policies are configured with NAT over VPN, the following Access Rules and NAT Policy would be auto-created:

Image 

Image 



How To Test:

Bring the tunnel up by pinging the NAT'ed (translated) ip in the remote site.
For eg. in order to connect to the Web Server having IP 192.168.1.100 in Site A from Site B, use the NAT'ed IP of 172.16.1.100.

Likewise, in order to connect to the host IP 192.168.1.5 in Site B from Site A, use the NAT'ed IP of 172.16.2.5.


Resolution for SonicOS 6.5 and Later

SonicOS 6.5 was released September 2017. This release includes significant user interface changes and many new features that are different from the SonicOS 6.2 and earlier firmware. The below resolution is for customers using SonicOS 6.5 and later firmware.

Network Setup:

Image

 

In this scenario, a VPN tunnel is created between a SonicWall NSA 2650 and a SonicWall NSA 4600, and NAT over VPN tunnel is configured to translate the networks to a different subnet. Site A subnet, 192.168.1.0/24 is translated to a virtual subnet of 172.16.1.0/24 and Site B subnet, 192.168.1.0/24 is translated to a virtual subnet of 172.16.2.0/24.

  • Site A: 192.168.1.0 /24 is mapped to 172.16.1.0 /24
  • Site B: 192.168.1.0 /24 is mapped to 172.16.2.0 /24

Configuring Site A (NSA 2650):

1)  Create Address Object for Local & Remote Network

Step  1. Login to your Sonicwall management page and click on Manage tab on top of the page.
Step  2. Navigate to Objects -> Address Objects page. On right Side, Click on Address objects tab and select View as Custom. 
Step  3. Click  Add button under Address Objects, to get Add Address Object  Window.  

Image

>> Create an Address Object called "Local Translated". This is the NAT'ed network for the local subnet.

  • Name: Local Translated
  • Zone: LAN
  • Network: 172.16.1.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual local subnets)

>> Create an Address Object called "Remote Translated". This is the NAT'ed network for the remote subnet.

  • Name: Remote Translated
  • Zone: VPN
  • Network: 172.16.2.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual remote subnets)

Image

2) Create VPN Policy:

Step 1: Login to your Sonicwall management page and click on Manage tab on top of the page.
Step 2: Navigate to VPN -> Base Settings page.
Step 3: Under VPN Policies,Click Add button to gett VPN Policy Window

Image

Step 4: Create a new Site to Site VPN policy with settings as per the screenshot.

Image


Configuring Site B (NSA 4600):

1)  Create Address Object for Local & Remote Network

Step  1. Login to your Sonicwall management page and click on Manage tab on top of the page.
Step  2. Navigate to Objects -> Address Objects page. On right Side, Click on Address objects tab and select View as Custom. 
Step  3. Click  Add button under Address Objects, to get Add Address Object  Window.  

Image

>> Create an Address Object called "Local Translated". This is the NAT'ed network for the local subnet.

  • Name: Local Translated
  • Zone: LAN
  • Network: 172.16.2.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual local subnets)

>> Create an Address Object called "Remote Translated". This is the NAT'ed network for the remote subnet.

  • Name: Remote Translated
  • Zone: VPN
  • Network: 172.16.1.0
  • Netmask: 255.255.255.0 (This is required to be identical to the actual remote subnets)

 Image

2) Create VPN Policy:

Step 1: Login to your Sonicwall management page and click on Manage tab on top of the page.
Step 2: Navigate to VPN -> Base Settings page.
Step 3: Under VPN Policies,Click Add button to gett VPN Policy Window

Image

Step 4: Create a new Site to Site VPN policy with settings as per the screenshot.

Image 


Once both VPN policies are configured with NAT over VPN, the following Access Rules and NAT Policy would be auto-created:

From VPN to LAN

 Image

From LAN to VPN

Image

NAT Policy

Image


How To Test:

Bring the tunnel up by pinging the NAT'ed (translated) ip in the remote site.
For eg. in order to connect to the Web Server having IP 192.168.1.100 in Site A from Site B, use the NAT'ed IP of 172.16.1.100.

Likewise, in order to connect to the host IP 192.168.1.5 in Site B from Site A, use the NAT'ed IP of 172.16.2.5.