Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I should say up-front that I am TOTALLY new to Linux, Ubuntu, and the technical side of networking. I am setting up Ubuntu on a server computer and have learned a bit about configuring the ufw firewall. I have set ufw to block all ports by default (sudo ufw default deny) and so far have added rules to open a couple of ports for SSH and game servers, but there is one thing I don't understand.

  • How is it that I am still able to update packages, ping IP addresses, etc. if ufw is supposedly blocking all (or almost all) of the ports?
  • Does ufw automatically allow traffic back from an IP address that I have connected to?

I'm sure there is a simple technical explanation but I'm having trouble finding it via Google.
Thank you!

share|improve this question
up vote 10 down vote accepted

Unless you've set up ufw to default-deny outgoing connections (which is not the default), then applications on your system can connect to external hosts. The connections made to external hosts are generally bidirectional - when you run, say, curl or apt-get, the programs make a connection to the remote host and can then both push data out and pull data down that connection.

ufw is set to default-accept outgoing connections because default-deny is basically the same as not being connected to the network. Depending on what you're trying to secure, though, default-deny outgoing might be the right policy.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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