Re: DNAT TCP 12345 -> 22
Try the rules below, simple and clean:
EXT_IF='eth1' # the interface connected to Internet
SERVER='192.168.0.1' # or any else IP allocated to machine
SSH='22'
SSH_SERVER='12345' # or another port you want
$IPTABLES -t nat -A PREROUTING -i $EXT_IF -p tcp --dport $SSH_SERVER -j DNAT --to $SERVER:$SSH
$IPTABLES -t filter -A FORWARD -i $EXT_IF -p tcp --dport $SSH -d $SERVER -j ACCEPT
note: server's sshd may listen on port 22 only.
Regards,
--
Márcio H. Parreiras @ Pedro Leopoldo - MG - Brazil
Por favor evite enviar-me anexos Excel (.xls), PowerPoint (.ppt) ou Word (.doc);
Veja http://www.gnu.org/philosophy/no-word-attachments.pt.html
Please avoid sending me Excel (.xls), PowerPoint (.ppt) or Word (.doc) attachments;
See http://www.gnu.org/philosophy/no-word-attachments.html
Navegue com segurança: http://br.mozdev.org
Surf safely: http://www.mozilla.com/en-US
Experimente http://www.broffice.org
Try http://www.openoffice.org
"A caixa dizia: Requer MS Windows ou superior, então eu instalei Debian/GNU Linux!"
http://www.debian.org/index.pt.html
"The box said: Requires MS Windows or better, then I installed Debian/GNU Linux!"
http://www.debian.org/index.en.html
http://pt.wikipedia.org/wiki/Linux
http://en.wikipedia.org/wiki/Linux
Codificação de caracteres / Character encoding: Unicode (UTF-8)
.
Reply to: