Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Exemplo de NAT
echo "Ativando: IP FORWARDING"
echo
echo "1" > /proc/sys/net/ipv4/ip_forward
##################
### PREROUTING ###
##################
echo "Carregando: Regras PREROUTING"
echo
iptables -t nat -I PREROUTING 1 -d 5.1.1.1 -p tcp --dport 80 -j DNAT --to 5.1.1.2:80 # APACHE
###################
### POSTROUTING ###
###################
echo "Carregando: Regras POSTROUTING"
echo
iptables -t nat -I POSTROUTING 1 -d 5.1.1.2 -p tcp --dport 80 -j SNAT --to 5.1.1.1 # APACHE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment