Is VPN + UFW (As a Killswitch) broken in 18.04?

I have been using Ubuntu (Lubuntu Distro) since 16.04 and have always used a VPN + UFW as a killswitch. It's a very simple thing to do. Especially with the GUFW GUI.

First, you simply deny incoming / outgoing connections by default. Then you allow outgoing on tun0 or whatever your OpenVPN adapter is labeled. This is almost ALWAYS tun0.

Since I ugpraded to tun0 the same rules I have used forever no longer work. Nothing is allowed through, even when I specify to allow traffic through on tun0.

Can anyone else confirm that UFW is not working properly in this aspect in 18.04? It seems to be working fine except it's not playing nice with the tun* adapters.

Answers 1

  • You need to add this line to your script.

    sudo ufw allow out on <wlan or enp0s3 from ifconfig> from any to <VPN IP>
    

    The complete script looks like this

    sudo ufw reset 
    sudo ufw default deny incoming
    sudo ufw default deny outgoing 
    sudo ufw allow out on <wlan or enp0s3 from ifconfig> from any to <VPN IP> 
    sudo ufw allow out on tun0 from any to any 
    sudo ufw enable
    

Related Questions