From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: Bill Hendrickson <wjhendrickson@gmail.com>
Cc: netfilter list <netfilter@vger.kernel.org>
Subject: Re: SSH Port Forwarding with iptables
Date: Fri, 02 Oct 2009 00:07:34 +0200 [thread overview]
Message-ID: <4AC52826.3030800@plouf.fr.eu.org> (raw)
In-Reply-To: <a0017e7e0910010824x697f1e82h57abe8df7ca68208@mail.gmail.com>
Bill Hendrickson a écrit :
>> In the FORWARD chain the destination port has already been changed by
>> the DNAT rule just like the destination address, so this rule must match
>> on destination port 22, not on the original destination port.
>
> So you're saying it needs to be this?
>
> $IPT -A FORWARD -p tcp -i $EXT_IFACE -o $INT_IFACE -d $SSH_HOST
> --dport 22 --sport 1024:65535 -m state --state NEW -j ACCEPT
Correct.
> For now, I've actually got it like this (which is working, but I
> should lock it down):
>
> -A FORWARD -p tcp -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
This is much too permissive, it allows any connection through the router.
next prev parent reply other threads:[~2009-10-01 22:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 15:16 SSH Port Forwarding with iptables Bill Hendrickson
2009-09-29 16:14 ` Bill Hendrickson
2009-10-01 10:37 ` Pascal Hambourg
2009-10-01 15:24 ` Bill Hendrickson
2009-10-01 22:07 ` Pascal Hambourg [this message]
2009-10-01 16:26 ` Gáspár Lajos
2009-09-29 16:16 ` Gáspár Lajos
2009-09-29 16:41 ` Bill Hendrickson
2009-09-29 17:00 ` Gáspár Lajos
2009-09-29 17:12 ` Bill Hendrickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AC52826.3030800@plouf.fr.eu.org \
--to=pascal.mail@plouf.fr.eu.org \
--cc=netfilter@vger.kernel.org \
--cc=wjhendrickson@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox