I've read the ubuntu developer docs regarding the ufw here, but couldn't find what I was looking for. It allows me to set rules for controlling in/out traffic based on source IP or port numbers, but what I want is to restrict based on applications. For example:

(1) only firefox.exe allowed to communicate on port 80 - outgoing

(2) only apache.exe/httpd.exe allowed to communicate on port 80 - incoming, etc.

(Hope you get what I'm trying to imply - this is possible in windows firewall).

I'm not able to see how I can achieve this with ufw firewall? Or is there a better alternative to ufw which is able to do this on linux?

1 Answer 1


I re-implemented the firewall entirely from scratch using iptables. Iptables gives more control and the rules are very simple to assign such as:

/sbin/iptables -A OUTPUT -o ppp0 -p tcp --dport 80 -j ACCEPT #http

Having do so, I've bid farewell to the ufw firewall:

sudo apt-get remove ufw

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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