View Full Version : [ubuntu] Disable Outgoing Packets with UFW
Hochler
March 25th, 2009, 09:11 PM
I've read many tutorials and threads on UFW, but all they talk about are blocking incoming packets. Is there anyway to block outgoing packets with UFW, specifically port 80? If not, is there any other way to do it? I've used firestarter, but I need a quick CLI way to disable/enable outgoing packets on port 80.
bodhi.zazen
March 25th, 2009, 10:15 PM
Not with ufw.
You can do it with iptables.
The nice thing about ufw, the rules for ufw are very similar for iptables.
See : http://bodhizazen.net/Tutorials/iptables/
lovinglinux
March 26th, 2009, 12:39 AM
I guess there is an workaround that requires editing ufw config file, but then is not practical if you need to block/accept outgoing packets regularly.
These might be helpful
http://www.google.com.br/search?en-US:&q=ufw+block+outgoing+site%3Aubuntuforums.org
http://www.google.com.br/search?en-US:&q=ufw+block+outbound+site%3Aubuntuforums.org
xoros
May 12th, 2010, 01:55 AM
Edit: nevermind, ufw does not seem to be able to do it.
I assume something like this would work:
sudo iptables -A OUTPUT -p tcp -m multiport --dports 80,8080,8081,443 -j DROP
And this to remove it when done:
sudo iptables -D OUTPUT -p tcp -m multiport --dports 80,8080,8081,443 -j DROP
bodhi.zazen
May 12th, 2010, 06:15 AM
This is an old thread.
UFW will do this now :
sudo ufw deny out 80
see man ufw
sudo ufw delete deny out 80
To multiport use
sudo ufw deny out 80,8080,8081,443/tcp
Your iptables rules will do this as well.
Powered by vBulletin® Version 4.2.2 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.