Skip to content

Instantly share code, notes, and snippets.

@richardhicks
Last active May 14, 2025 19:13
Show Gist options
  • Save richardhicks/5ca272c520d72e3f3daee23332dbfa55 to your computer and use it in GitHub Desktop.
Save richardhicks/5ca272c520d72e3f3daee23332dbfa55 to your computer and use it in GitHub Desktop.
Configure NAT64 on Windows Server
# This Gist contains PowerShell commands to enable NAT64 on a Windows server.
# Reference: https://learn.microsoft.com/en-us/powershell/module/networktransition/new-netnattransitionconfiguration
# Define variables
$AcceptInterface = 'LAN' # The interface name or alias that will accept NAT64 traffic
$SendInterface = 'DMZ' # The interface name or alias that will send NAT64 traffic
$Nat64Prefix = '64:ff9b::/96' # The NAT64 prefix
$Ipv4Address = '172.16.1.216' # The IPv4 address of the NAT64 server
# Configure NAT64
New-NetNatTransitionConfiguration -InstanceName NAT64 -State Enabled -InboundInterface $AcceptInterface -OutboundInterface $SendInterface -PrefixMapping "$Nat64Prefix,0.0.0.0/0" -IPv4AddressPortPool "$Ipv4Address,6001-47000"
#Set-NetIPInterface -InterfaceAlias $InterfaceAlias -AddressFamily IPv6 -Forwarding Enabled
Set-NetIPInterface -InterfaceAlias $AcceptInterface -AddressFamily IPv6 -Forwarding Enabled
# Clear NAT64 configuration
Remove-NetNatTransitionConfiguration -InstanceName NAT64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment