Force VPN Traffic On TUN Adapter

When using a local VPN server, it is advisable to segregate internal and external network traffic over the different interfaces. Usual configuration is to have internal traffic over eth0 and external traffic over tun0.

To ensure that external traffic does not go over the wrong interface, use the following rules (change internal network address range and target VPN port as needed)

To make the rules permanent, follow the instructions in Make IPTables Rules Permanent.

Also, ensure that the ufw service is disabled as its rules can override those above and permit application access over the incorrect interface

Leave a Reply

Your email address will not be published. Required fields are marked *