From: Simion Onea <simionea@gmail.com>
To: Mike Williams <dmikewilliams@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Forwarding packets over the same LAN
Date: Thu, 16 Jul 2009 08:59:57 +0300 [thread overview]
Message-ID: <1247723997.15457.46.camel@TestField.intranet.bem.md> (raw)
In-Reply-To: <cfb4555b0907151312w371c0aa3j7fc5db21d301a38a@mail.gmail.com>
On Wed, 2009-07-15 at 16:12 -0400, Mike Williams wrote:
> Simon,
>
> Hi there. Would you mind posting the output of iptables-save? After
> reading about your battle with this it would be nice to see the
> complete set of working rules. Also, having the final solution in the
> archives may help someone else.
>
> Thanks,
>
> Mike
Hi Mike!
Well, our set of iptables rules is rather large. It performs several
tasks like blocking access to some ports on the server, blocking access
to some hosts, performing NAT for other hosts, etc.
To be useful for the community, this set of rules would require a
detailed explanation which I am not prepared to give because our
company's policies do not allow me to do so.
But the solution to my problem were the couple of rules proposed by
Thomas Jacob:
> On Mon, 2009-07-13 at 16:14 +0200, Thomas Jacob wrote:
> > You need DNAT+SNAT for this:
> >
> > # Redirect to IP:Port
> > iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 10025 \
> > -j DNAT --to-destination 172.20.1.254:25
> >
> > # Ensure that the replies come back to us
> > iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 25 \
> > -d 172.20.1.254 -j SNAT --to-source 172.20.1.245
These rules did the job, but there was another one that I didn't notice
at first. This rule was blocking traffic to port 25:
# iptables -A FORWARD -p tcp -s 172.20.1.245 -d 0/0 --dport 25 -j DROP
As soon as I removed this rule everything went fine.
Regards,
Simion.
prev parent reply other threads:[~2009-07-16 5:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 14:00 Forwarding packets over the same LAN Simion Onea
2009-07-13 14:14 ` Thomas Jacob
2009-07-14 7:58 ` Simion Onea
2009-07-14 9:25 ` Mart Frauenlob
2009-07-14 12:20 ` Simion Onea
2009-07-14 12:40 ` Mart Frauenlob
2009-07-14 12:30 ` Thomas Jacob
2009-07-14 12:27 ` Thomas Jacob
2009-07-14 13:06 ` Simion Onea
2009-07-15 7:38 ` Simion Onea
2009-07-14 15:33 ` Pascal Hambourg
2009-07-14 18:50 ` Simion Onea
2009-07-14 15:34 ` Thomas Jacob
2009-07-14 19:01 ` Simion Onea
2009-07-14 20:36 ` Vincent Bernat
2009-07-15 7:32 ` Pascal Hambourg
2009-07-15 7:40 ` Simion Onea
2009-07-15 20:12 ` Mike Williams
2009-07-16 5:59 ` Simion Onea [this message]
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=1247723997.15457.46.camel@TestField.intranet.bem.md \
--to=simionea@gmail.com \
--cc=dmikewilliams@gmail.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