forwarding ssh requests

Thomas Cameron plug-discuss@lists.plug.phoenix.az.us
Tue, 20 May 2003 14:11:33 -0500


Never mind, I got it to work like so:

[root@mailtest1 root]# iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport
3022 -j DNAT --to-destination 127.0.0.1:22
[root@mailtest1 root]# ssh 127.0.0.1 -p 3022
root@127.0.0.1's password:
Last login: Tue May 20 14:09:45 2003 from localhost.localdomain

Don't understand why it works on the OUTPUT chain but not PREROUTING, tho.

TC
----- Original Message ----- 
From: "David A. Sinck" <plug-discuss@grueslayer.com>
To: <plug-discuss@lists.plug.phoenix.az.us>
Sent: Tuesday, May 20, 2003 1:35 PM
Subject: forwarding ssh requests


>
>
> \_ SMTP quoth Liberty Young on 5/20/2003 11:27 as having spake thusly:
> \_
> \_
> \_
> \_ I'm trying to forward ssh requests from one machine to another  from
the
> \_ internet.
> \_
> \_ i.e., ssh to my home gateway from work on port 22 does just that (this
> \_ works already).
> \_ but if i ssh to my home gateway's IP from work, on port 3022 for
> \_ example, would actually be logging me into another box behind my
> \_ gateway.
> \_
> \_ I've been googling for iptable rules for this, but i'm not finding one.
> \_ Do you guys have any iptable examples or other suggestions?
>
> /sbin/iptables -t nat  -A PREROUTING -p tcp -m tcp --dport 3022 \
>                        -j DNAT --to-destination 192.168.0.10:22
>
>
> David
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>