Remember how to nat your network

Is a good idea to remember how to nat a network, so the lessons learned are always good lessons. This is for most linux distributions and not permanent changes (let's say a reboot will destroy this change).

# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

Also make sure we have a default gateway on the internal network:

# route add default gw aaa.bbb.ccc.ddd

And that's it.

More details on: http://www.revsys.com/writings/quicktips/nat.html
Publicar un comentario

Entradas populares de este blog

Cómo tener un cultivo de búlgaros (Kéfir) por años

Jugando con la API de bitso: bitso-py

Mientras tanto, en internet... MUJERES CHINGONAS