How do I get NAT working across Azure VPN?

PW 15 Reputation points
2023-01-19T20:07:40.7666667+00:00

I’ve set up a test environment and connected to Azure with my home computer using a pFsense router. I can get NAT over Azure VPN working in one direction from my home side; however, as soon as I set NAT up for the address in Azure, the connection fails. IKE Phase 1 connects fine. During IKE Phase 2, the log says that it’s matching all the NAT IPs, child_sa changes state to Installed, but then immediately destroys the connection. I've checked and double checked the requirements and limitations for Azure NAT over VPN and couldn't find anything amiss. Again the VPN connection works both without NAT and with NAT on the Pfsense side, but not with NAT set up on Azure side. Below are my Azure NAT settings:

azurenat

and the pfsense log:

pfsense logs

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,374 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Silvia Wibowo 2,851 Reputation points Microsoft Employee
    2023-01-19T23:56:33.2766667+00:00

    Hi PW, please use IP address in the range of RFC 1918 or RFC 6598 for your NAT target.

    Reference: IP Addresses in VNet.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.