Postado originalmente por
beowulf
Consegui fazer funcionar assim, mais nao sei se e a melhor forma de fazer:
# Politicas default
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
.......
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5222 -j DNAT --to 192.168.0.27
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 5222 -j DNAT --to 192.168.0.27
iptables -t nat -A PREROUTING -s 192.168.0.0/255.255.255.0 -d 200.xxx.xx.xx -p tcp --dport 5222 -j DNAT --to-destination 192.168.0.27:5222
iptables -A INPUT -p tcp -s 192.168.0.0/255.255.255.0 --destination-port 5222 -j ACCEPT
.......
iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE