openvpn – How to force all traffic through VPN?

How to force all traffic through OpenVPN

 

Add the following directive to the server configuration file:

push “redirect-gateway def1”

If your VPN setup is over a wireless network, where all clients and the server are on the same wireless subnet, add the local flag:

push “redirect-gateway local def1”

Pushing the redirect-gateway option to clients will cause all IP network traffic originating on client machines to pass through the OpenVPN server. The server will need to be configured to deal with this traffic somehow, such as by NATing it to the internet, or routing it through the server site’s HTTP proxy.

If you want to configure this on the client side, put

redirect-gateway def1

in your client.ovpn file.

Some stuff about things