Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jan Humme <jan.humme@xs4all.nl>
To: deepali <deepali@gecsl.com>, netfilter@lists.samba.org
Subject: Re: port forward using iptables not happening
Date: Fri, 5 Jul 2002 13:20:25 +0200	[thread overview]
Message-ID: <02070513202502.14428@Lms> (raw)
In-Reply-To: <001e01c223ef$7bdc0d50$0805010a@gecs.net>

On Friday 05 July 2002 08:44, deepali wrote:
> Dear Support
> My setup is ..I have one linux box having eth0(valid ip202.140.152.33) and
> eth1(invalid ip-local lan192.168.220.250) .I have one more machine in my
> Local Lan (192.168.220.90) which is a mail server in my local LAN.Now I
> want to 1.enable port forwarding ie any request comming on 202.140.152.33
> port 285 should get forwarded to 192.168.220.90 port 25 my mail server.
>
> 2.Also any request comming from my lan ie 192.168.220.0/24 to invalid ip of
> linux box ie 192.168.220.90 285 should also forwarded to my Mail server in
> lan ie 192.168.220.30 port 25.
>
> My first synario is also not working.
>
> my rules are
>
> iptables -t nat -A PREROUTING -i eth0  -p tcp -d 202.140.136.90 --dport 285
> -j DNAT 182.168.220.90:25

You must have seen syntax error complaints about the DNAT option from 
iptables; in fact it should be:

#iptables -t nat -A PREROUTING -i eth0 -p tcp -d 202.140.136.90 --dport 285 
-j DNAT --to-destination 192.168.220.90:25

> iptables -t nat -A POSTROUTING  -o eth0 -j MASQURADE

Should read: MASQUERADE, but in that case is OK, and allows your local 
machines to get out to the internet.

> iptables -t nat -A POSTROUTING -s 192.168.220.0/24 -j MASQURADE

?? Why? Isn't this already covered by the previous masquerading rule?

And how about:

#iptables -t nat -A PREROUTING -p tcp -d 192.168.220.90 --dport 285 -j DNAT 
--to-destination 192.168.220.90:25

This is the exact equivalent of your point 2), only expressed in iptables 
syntax.

Jan Humme.


  parent reply	other threads:[~2002-07-05 11:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-05  6:44 port forward using iptables not happening deepali
2002-07-05  7:24 ` José Alberto Aguilar González
2002-07-05  7:48 ` Stewart Thompson
2002-07-05 11:20 ` Jan Humme [this message]
2002-07-06  2:34   ` deepali

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=02070513202502.14428@Lms \
    --to=jan.humme@xs4all.nl \
    --cc=deepali@gecsl.com \
    --cc=netfilter@lists.samba.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