Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Ramin Dousti <ramin@cannon.eng.us.uu.net>
To: Internet Protocol version Six <inet6@mail.be>
Cc: netfilter@lists.netfilter.org
Subject: Re: Forwarding a port on the LAN
Date: Sun, 6 Jul 2003 02:12:12 -0400	[thread overview]
Message-ID: <20030706061212.GA12152@cannon.eng.us.uu.net> (raw)
In-Reply-To: <1335069572.1057466520812.JavaMail.Administrator@pumbaa>

Just follow the packet flow and you'll see what's happening.

192.168.0.3:whatever sends SYN to 192.168.0.1:1600

the packet gets DNAT'ed and becomes:

192.168.0.3:whatever sends SYN to 192.168.0.2:23

192.168.0.2:23 sends the SYN,ACK to 192.168.0.3:whatever which sits on the
same LAN and does not go through the router to get corrected to its original
state. You need to SNAT the LAN communication to the router's IP to ensure
the return path back to the router.

This is a VFAQ and needs to be explained in the basic Nat HOW-TO of netfilter,
if it's already not there...

Ramin

On Sun, Jul 06, 2003 at 06:42:00AM +0200, Internet Protocol version Six wrote:

> I want to forward a connection to the router (192.168.0.1:1600) to 192.168.0.2:23 which from the Internet works fine, however if I connect from a LAN machine (192.168.0.3) to the router on port 1600 I get a "Connection timed out". I use the following rule:
> 
> iptables -I PREROUTING -t nat -p tcp --dport 1600 -j DNAT --to 192.168.0.2:23
> 
> I don't see anything wrong with this, or am I forgetting something?
> 
> wkg,
> 
> -----------------------------------------------------
> Mail.be, WebMail and Virtual Office
> http://www.mail.be
> 


  reply	other threads:[~2003-07-06  6:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-06  4:42 Forwarding a port on the LAN Internet Protocol version Six
2003-07-06  6:12 ` Ramin Dousti [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-07-06 22:18 George Vieira

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=20030706061212.GA12152@cannon.eng.us.uu.net \
    --to=ramin@cannon.eng.us.uu.net \
    --cc=inet6@mail.be \
    --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