Here are the rules of my firewall :
deny outgoing deny incoming allow out from any to any on tun0 (alow just the traffic from the VPN)
However, I am forced to disable ufw when I want to start my vpn connection from gnome-network manager. Yet, I tried something like :
allow out from any to any on wlan0 port 1194
But it does not work.
Any suggestions ?
Those following lines enable you to block all the outgoing NON-VPN traffic. In other words, only the VPN traffic is allowed. Besides, in case your VPN connection failed, you will be able to reconnect without disabling your firewall.
1 - Run the following command in a terminal :
sudo tail -f /var/log/ufw.log
2 - Try to connect to your VPN
3 - Look at all the "[UFW BLOCK]"'s lines with an Ip adress In my case, I have two adress ip with DST=...240 and DST="...241.
Then I have the Ip given by my VPN which is also blocked.
3 - Allow those ip in your firewall :
To Action From -- ------ ---- ***.**.**.240 ALLOW OUT Anywhere ***.**.**.241 ALLOW OUT Anywhere **.***.0.0/18 (VPN) ALLOW OUT Anywhere Anywhere ALLOW OUT Anywhere on tun0 22/tcp ALLOW OUT Anywhere Anywhere (v6) ALLOW OUT Anywhere (v6) on tun0 22/tcp (v6) ALLOW OUT Anywhere (v6)