All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksander Kamenik <aleksander@krediidiinfo.ee>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] DNAT PREROUTING issue with IPTABLES
Date: Tue, 25 Sep 2007 07:50:43 +0000	[thread overview]
Message-ID: <46F8BDD3.1080703@krediidiinfo.ee> (raw)
In-Reply-To: <7ed6b0aa0709242228u211036fdoa33ffa47519ecb2e@mail.gmail.com>

Indunil Jayasooriya wrote:
> FIRST firewall (its internet ip address - 1.2.3.4/29 
> <http://1.2.3.4/29>) I have addes below rule.
> 
> iptables -t nat -A PREROUTING -p tcp -i eth0 -d 1.2.3.4 <http://1.2.3.4> 
> --dport 25 -j DNAT --to-destination 2.3.4.5:25 <http://2.3.4.5:25>
> 
> That should forward port 25 to SECOND firewall. in SECOND firewall, I 
> have added 2 below rules.
> 
> iptables -t nat -A PREROUTING -p tcp -i eth0 -d 2.3.4.5 <http://2.3.4.5> 
> --dport 25 -j DNAT --to-destination 192.168.100.3:25 
> <http://192.168.100.3:25>
> 
> iptables -A FORWARD -p tcp -d 192.168.100.3 <http://192.168.100.3> 
> --dport 25 -m state --state NEW -j ACCEPT

First run tcpdump* or the like on the smtp box to see that incoming 
packets arrive. If they don't, see if they arrive on 2.3.4.5 etc.

If they arrive at the destination see how much they go back (tcpdump on 
the firewall boxes).

Btw, assuming both of your firewall boxes have similar iptables 
rulesets, shouldn't the first one also have a -t filter -A FORWARD ... 
-j ACCEPT rule? Make sure you also have the ESTABLISHED,RELATED -j 
ACCEPT rules.

And have you made sure that the smtp box accepts connections from 
anywhere? Is your MTA listening on the external interface?

* - tcpdump -i eth0 port 25

Regards,

-- 
Aleksander Kamenik
system administrator
+372 6659 649
aleksander@krediidiinfo.ee

Krediidiinfo AS
http://www.krediidiinfo.ee/
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

  reply	other threads:[~2007-09-25  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25  5:40 [LARTC] DNAT PREROUTING issue with IPTABLES Indunil Jayasooriya
2007-09-25  7:50 ` Aleksander Kamenik [this message]
2007-09-25  8:35 ` Indunil Jayasooriya
2007-09-25  8:44 ` Aleksander Kamenik
2007-09-25  8:54 ` Riccardo (SCASI)
2007-09-25  9:18 ` Indunil Jayasooriya
2007-09-25  9:48 ` Aleksander Kamenik
2007-09-25 10:12 ` Indunil Jayasooriya

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=46F8BDD3.1080703@krediidiinfo.ee \
    --to=aleksander@krediidiinfo.ee \
    --cc=lartc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.