[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DNAT TCP 12345 -> 22

Try the rules below, simple and clean:

EXT_IF='eth1'    # the interface connected to Internet
SERVER=''    # or any else IP allocated to machine
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.


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!"

"The box said: Requires MS Windows or better, then I installed Debian/GNU Linux!"



Codificação de caracteres / Character encoding: Unicode (UTF-8)
Reply to: