Usando ufw Uncomplicated Firewall

9 05 2013

Habilitar:
# ufw enable

Parar:
# ufw disable

Abrir purto:
# ufw allow 22

Cerrar puerto abierto:
# ufw deny 22

Borrar regla aplicada:
# ufw delete deny 22

Habilitar puerto de manera más concreta:
# ufw allow proto tcp from 192.168.0.2 to any port 22

Evitar que corte sesiones ssh iniciadas. Añadir a /etc/ufw/before.rules:
# allow ssh to work
-A ufw-before-input -p tcp --dport 22 -j ACCEPT

Habilitar ip masquerading:
# echo "net.ipv4.ip_forward=1" > /etc/ufw/sysctl.conf
y añadir a /etc/ufw/before.rules:
# nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

Más info:
https://help.ubuntu.com/8.04/serverguide/firewall.html
https://wiki.ubuntu.com/UbuntuFirewallSpec
http://manpages.ubuntu.com/manpages/hardy/en/man8/ufw.8.html

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: