4

I enabled ufw as a security practice. And let the default setting intact. I noticed that I still be able to access internet using web browser, so I tested the firewall with transmission. Transmission reported the port was closed. Then I allowed the port, and transmission reported it was opened.

This make me confused. Why I still can surf the web when the default setting of firewall denies all incoming traffic of every port? Are there other places for setting?

Thanks.

3
  • 2
    You initiate connection from your web browser and the firewall lets that "established" connection to come back to your PC. help.ubuntu.com/community/IptablesHowTo
    – mbiber
    Commented Jan 14, 2016 at 13:09
  • 3
    Yes, that is normal. Transmission does not initiate connection towards some other peer, it just listens for it so its port needs to be allowed in firewall. Set default-deny for outgoing and you'll block all traffic. It's a statefull firewall so it knows what state the connections are in. Based on that it filters them. en.wikipedia.org/wiki/Stateful_firewall
    – mbiber
    Commented Jan 14, 2016 at 13:15
  • 2
    UFW blocks incoming connections not incoming data. If you are running an apache server, you should not be able to access it on port 80 from another computer.
    – mchid
    Commented Jan 15, 2016 at 3:39

1 Answer 1

1

Your web browser initiate outgoing connection. Ufw by default is blocking incoming connection. If you want block all web browser traffic you could add this rule:

sudo ufw deny out http  
sudo ufw deny out https

Or you can change default policy to deny outgoing :

sudo ufw default deny outgoing  

Now all your outgoing traffic will be blocked, until you allow something by the rule

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .