From: "Rob Sterenborg" <rob@sterenborg.info>
To: david@stpenable.com, netfilter@vger.kernel.org
Subject: RE: Failing to get forwarding to work fully.
Date: Mon, 4 Feb 2008 07:29:05 +0100 [thread overview]
Message-ID: <001201c866f7$3e096ee0$ba1c4ca0$@info> (raw)
In-Reply-To: <47A642E4.5040006@roamware.co.uk>
> Tried this, it made no difference. I broadened the ports on the NEW
> to cover 722, so there was no confusion to the port 22 used to connect
> to the machine with the public facing NIC.
Actually, this should be working:
-P FORWARD DROP
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -m state --state NEW -i eth1 -o eth0 \
-d 192.168.0.0/16 -p tcp --dport 22 -ACCEPT
-t nat -A PREROUTING -i eth1 -p tcp --dport 722 -j DNAT \
--to 192.168.0.223:22
If you're running a local ssh server on port 22 there will be no
confusion on this host. You'll be accepting packets on (local) port 22
which are accepted in the INPUT chain. Packets forwarded from port 722
to 192.168.0.223:22 will (only) travel the FORWARD chain (of the filter
table) because they're routed through the host.
> Do I need a postrouting rule for the FORWARD used for the return
packets?
No that would be handled by the RELATED,ESTABLISHED rule.
Besides, you already have an SNAT rule:
-A POSTROUTING -o eth1 -j SNAT --to-source 333.333.333.333
so you should be able to access the internet from 192.168.0.223, but
that should not be related to the problem.
Grts,
Rob
next prev parent reply other threads:[~2008-02-04 6:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-03 16:53 Failing to get forwarding to work fully David at roamware
2008-02-03 17:19 ` Rob Sterenborg
2008-02-03 22:40 ` David at roamware
2008-02-04 6:29 ` Rob Sterenborg [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-02-03 16:52 David Wynter
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='001201c866f7$3e096ee0$ba1c4ca0$@info' \
--to=rob@sterenborg.info \
--cc=david@stpenable.com \
--cc=netfilter@vger.kernel.org \
/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