From: Dan Daugherty <rescue@ddaniscool.com>
To: "Покотиленко Костик" <casper@meteor.dp.ua>
Cc: netfilter@vger.kernel.org
Subject: Re: IP Forwarding works on local port but not a remote port
Date: Fri, 5 Feb 2010 15:46:43 -0500 [thread overview]
Message-ID: <81ed8b881002051246i241b325mac3463efce13e151@mail.gmail.com> (raw)
In-Reply-To: <81ed8b881002051204q42413b75p6e83564f055a35aa@mail.gmail.com>
Well, I ended up figuring it out. I swear I tried this early on
because this is how I wanted it to work in the first place.
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 1524 -i eth0 -j DNAT --to
10.117.1.203:1524
That is all I needed. The machine sits behind another firewall so
none of the other chains are necessary. Thanks for all the help.
Dan
On Fri, Feb 5, 2010 at 3:04 PM, Dan Daugherty <rescue@ddaniscool.com> wrote:
> Forgot to mention I'm on a Redhat Enterprise Linux 5 box with the
> stock kernel. Tried to compile my own and the build fails
> immediately. I assumed that since I can route requests locally, the
> kernel was compiled properly for iptables.
>
> On Fri, Feb 5, 2010 at 3:01 PM, Dan Daugherty <rescue@ddaniscool.com> wrote:
>>> Are you using /16 netmask?
>> No, I just took the 10.117 part off the ip's to shorten the message.
>>>
>>>
>>> None of them got SNATed. Why? Should they go out through eth0? Try to
>>> remove "-o eth0".
>> Removed it and no change
>>>
>>> Also do you have ip.forwarding enabled (sysctl -a | grep forward")?
>> net.ipv6.conf.eth0.forwarding = 0
>> net.ipv6.conf.default.forwarding = 0
>> net.ipv6.conf.all.forwarding = 0
>> net.ipv6.conf.lo.forwarding = 0
>> net.ipv4.conf.eth0.mc_forwarding = 0
>> net.ipv4.conf.eth0.forwarding = 1
>> net.ipv4.conf.lo.mc_forwarding = 0
>> net.ipv4.conf.lo.forwarding = 1
>> net.ipv4.conf.default.mc_forwarding = 0
>> net.ipv4.conf.default.forwarding = 1
>> net.ipv4.conf.all.mc_forwarding = 0
>> net.ipv4.conf.all.forwarding = 1
>>
>>>
>>> Can you reach 10.117.1.205:1521 from sethra (telnet 10.117.1.205 1521)?
>>>
>> Negative, but the command from sethra fails immediately with nothing
>> showing in the logs
>>
>> There has also been mention of a FORWARD chain being necessary. I
>> haven't done anything outside of the commands listed in this thread.
>>
>
next prev parent reply other threads:[~2010-02-05 20:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 15:47 IP Forwarding works on local port but not a remote port Dan Daugherty
2010-02-05 17:11 ` Покотиленко Костик
2010-02-05 18:16 ` Dan Daugherty
[not found] ` <81ed8b881002051013n5f020a3fladfda4a5f33aa625@mail.gmail.com>
2010-02-05 18:24 ` Покотиленко Костик
2010-02-05 19:14 ` Dan Daugherty
2010-02-05 19:37 ` Christoph Paasch
2010-02-05 19:50 ` Покотиленко Костик
2010-02-05 20:01 ` Dan Daugherty
2010-02-05 20:04 ` Dan Daugherty
2010-02-05 20:46 ` Dan Daugherty [this message]
2010-02-05 21:10 ` Christoph Paasch
2010-02-05 20:53 ` Покотиленко Костик
2010-02-05 20:51 ` Christoph Paasch
2010-02-05 20:52 ` Покотиленко Костик
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=81ed8b881002051246i241b325mac3463efce13e151@mail.gmail.com \
--to=rescue@ddaniscool.com \
--cc=casper@meteor.dp.ua \
--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