(Question) Prevent Windows from Sending Data when NOT connected to OpenVPN?

So what I want to happen on my Windows computer is:

When not connected to OpenVPN Server (at my home address): SEND NO DATA to LAN/WAN
When connected to OpenVPN Server (at my home address): Forward ALL DATA through VPN


Another way of saying what I want to happen is prevent all network communication (except outgoing/ingoing OpenVPN requests) on my Windows computer, until the OpenVPN connection has been established. Once that connection has been established, forward all data through the connection (the second part I think it does automatically once the connection has been established?)


I know there was/is a VPN provider that did/does this, since it used to be advertised as a popular feature. Now I want to do this with OpenVPN, but I have no idea how. I’ve tried Ducking It and Googling the question, and trying various ways at rewording to try to get my message across, but couldn’t find any answers (nor questions) for what I want to do.

Any help wanted! Thanks! :smiley:

What you want is a “Kill-switch”. It seems that OpenVPN doesn’t have this feature, from my 2 minutes of googling. There are more manual methods though, like

1 Like

Restrict your windows machine to a single ip address(your openvpn server) on your router.

iptables -I FORWARD 1 -m mac --mac-source 00:00:00:12:34:56 -d yyy.yyy.yyy.yyy -j ACCEPT
iptables -I FORWARD 2 -m mac --mac-source 00:00:00:12:34:56 -j DROP

replace mac with your PC mac address and yyy.yyy.yyy.yyy with ip address of your server.

You need to have access to your router’s ssh, it must have iptables and a way for custom rules to survive the reboot.