Linux Netfilter discussions
 help / color / mirror / Atom feed
From: udo <udovdh@yahoo.com>
To: netfilter@lists.netfilter.org
Subject: martians and portforwarding to 127.0.0.1
Date: Tue, 20 Apr 2004 09:33:26 -0700 (PDT)	[thread overview]
Message-ID: <20040420163326.32095.qmail@web40706.mail.yahoo.com> (raw)

Hello,

To be able to run sshd from an unpriviliged port I
want to let sshd listen to just the lo (12.0.0.1)
interface, port 2222 and forward connections to port
22 on my internet and LAN interfaces to 127.0.0.1:22.
To enable this I use something like:

$path_iptables -t nat -A PREROUTING -p tcp -i $ext_if
-s 0/0 -d $ext_ip --dport 222 -j DNAT --to
127.0.0.1:22
$path_iptables -t nat -A PREROUTING -p tcp -i
$local_if -s $local_net -d $local_ip --dport 222 -j
DNAT --to 127.0.0.1:22

$path_iptables -A FORWARD -p tcp -i $ext_if -o lo  -s
0/0 -d 127.0.0.1 --dport 22 -m state --state NEW -j
ACCEPT
$path_iptables -A FORWARD -p tcp -i $local_if -o lo -s
$local_net -d 127.0.0.1 --dport 22 -m state --state
NEW -j ACCEPT

(for a test I enabled port 222 -> 127.0.0.1:22)

This makes the following message appear in the log:

blabla kernel: martian destination 127.0.0.1 from
x.y.z.q, dev ppp0

How can I make the sshd (attached to loopback) work
without `martian destination` messages for packets
destined for port 22?
Please post!

Kind regards,
Udo


	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash


             reply	other threads:[~2004-04-20 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20 16:33 udo [this message]
2004-04-20 16:42 ` hello german speaking? marc manthey
2004-04-20 16:59   ` Antony Stone
2004-04-20 16:43 ` martians and portforwarding to 127.0.0.1 David Cannings
2004-04-20 17:00 ` Antony Stone
2004-04-20 17:20 ` Cedric Blancher

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=20040420163326.32095.qmail@web40706.mail.yahoo.com \
    --to=udovdh@yahoo.com \
    --cc=netfilter@lists.netfilter.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