Ubuntu Firewall - easy way

Hal Burgiss hal at burgiss.net
Fri Jul 27 20:23:09 UTC 2012


On Fri, Jul 27, 2012 at 11:17 AM, Valter Nogueira <valter at fastway.com.br>wrote:

> Is there any easy way to implent a firewall on Ubuntu?
>
>
No GUI needed! Default policy, allow local connections to myself, my own
established connections that I initialize to anywhere else, and drop the
rest. This assumes you aren't running any services you want exposed.

# flush rules
iptables -F INPUT
iptables -P INPUT DROP
# allow loopback traffic
iptables -A INPUT -s lo -j ACCEPT
# allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# everything else droppped.

Paste into /etc/rc.local.

-- 
Hal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20120727/98e70652/attachment.html>


More information about the ubuntu-users mailing list