Skip to content

Instantly share code, notes, and snippets.

@abstrask
Created September 13, 2018 21:46
Show Gist options
  • Save abstrask/3d9ae4beb68e98a957a02c17a357fcc0 to your computer and use it in GitHub Desktop.
Save abstrask/3d9ae4beb68e98a957a02c17a357fcc0 to your computer and use it in GitHub Desktop.
$RemoteNetwork = "192.168.1.0/24", "10.0.0.0/24"
# Enable connection when both VPN server and client is behind NAT-T
# http://support.microsoft.com/kb/926179
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\PolicyAgent -Name AssumeUDPEncapsulationContextOnSendRule -Type DWord -Value 2 -Force
# Add route(s) to remote networks
$RemoteNetwork | % {Add-VpnConnectionRoute -ConnectionName $VPNConnectionName -DestinationPrefix $_}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment