I'm trying to set UFW (using GUFW) to create a firewall that only allows network connections when OpenVPN is connected.

So in GUFW I deny incoming and outgoing connections and enable the Firewall. I then create a rule that allows incoming/outgoing of the openvpn service.

Interestingly, with these settings I'm able to make a VPN connection using Network Connections, however I'm unable to browse. Note that without these rules I'm unable to make the VPN connection.

I've also tried creating a rule using the OpenVPN ports and VPN IP address with no success.

To troubleshoot, I delete those rules and create more broad rules of allowing incoming/outgoing HTTP and HTTPS. With these rules in place, I'm still unable to browse online. I tried this while creating rules with my IP address, and no luck.

Here's an example of my current rules, which is not allowing me to browse.

user1@vuser-pc1:~$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
80/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere (v6)
443/tcp                    ALLOW       Anywhere (v6)

80/tcp                     ALLOW OUT   Anywhere
443/tcp                    ALLOW OUT   Anywhere
80/tcp                     ALLOW OUT   Anywhere (v6)
443/tcp                    ALLOW OUT   Anywhere (v6)

Is there something I'm doing wrong?

Edit: If I set "allow" outgoing, and then create rules to disallow http/https connections, the rules work. I cannot browse. It is strange to me that in this case the rules work to disallow, but I can't get it to allow.

1 Answer 1


It's because a browser is changing the port: Try this for know the port:

netstat -anp | grep

But it's changing a lot (in my case).

Similar inverse problem: https://answers.launchpad.net/ubuntu/+question/106974

  • But if I set the firewall rules not based on Port but on IP, it still doesn't work.
    – rivitzs
    Feb 24, 2014 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.