I’ll shortly be traveling to a country with less lenient laws regarding free speech.
I have a Windows 10 machine. I want to block this machines possibility to communicate on all interfaces except over a VPN tunnel (there is a network port and WiFi). If the VPN tunnel is down for any reason no network traffic is allowed. Not even on LAN.
If it’s easier to do this with windows server I’ll gladly switch.
I have found several posts regarding windows firewall which I have tried to follow but in my experience it does not catch everything (might be errors on my side though).
I also have software such as Windscribe VPN but I have managed to go around its firewall when it goes down so I don’t trust it, and it does not seem to block DNS queries at all (I was catching lots of dns queries in PiHole when Windscribe was blocking)
Can this be accomplished with some clever power shell?
Thanks for the help!
The easiest way to achieve this is using the LockDown VPN Feature on Windows 10. With this feature all traffic must ONLY go over VPN and cannot go over other interfaces (except for traffic needed to establish basic connectivity as well as the VPN Connection) More information on deploying this feature is @ https://docs.microsoft.com/en-us/windows/client-management/mdm/vpnv2-csp
A VPN Profile XML sample for such a configuration is as follows:
A Powershell script to feed this VPN Profile XML too will look like as follows. Note that to run this you will need to run the PS script as System using PSexec from: https://technet.microsoft.com/sysinternals/bb897553.aspx, by running Psexec.exe -i -s cmd.exe
You can find more information about Windows 10 VPN options @ https://docs.microsoft.com/en-us/windows/access-protection/vpn/vpn-security-features