From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Bas van Sisseren <bas@quarantainenet.nl>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] ipt_REDIRECT: only change dest-ip if not local ip
Date: Fri, 16 Jul 2010 16:58:23 +0200 [thread overview]
Message-ID: <4C40738F.900@trash.net> (raw)
In-Reply-To: <alpine.LSU.2.01.1007161654030.32253@obet.zrqbmnf.qr>
Am 16.07.2010 16:56, schrieb Jan Engelhardt:
> On Friday 2010-07-16 14:49, Patrick McHardy wrote:
>>> Assume:
>>> eth0 has these addresses:
>>> 10.1.0.1, netmask 255.255.255.0 (primary address)
>>> 10.2.0.1, netmask 255.255.255.0
>>> 10.3.0.1, netmask 255.255.255.0
>>> 10.4.0.1, netmask 255.255.255.0
>>>
>>> and redirects from.. say.. port 80 to 8080
>>>
>>> Connections to 10.1.0.1:80 will be redirected to 10.1.0.1:8080
>>> But also all connections to 10.2.0.1:80, 10.3.0.1:80 and
>>> 10.4.0.1:80 will be redirected to 10.1.0.1:8080
>>>
>>>
>>> With the patch, the connection to 10.2.0.1:80 will be redirected to
>>> 10.2.0.1:8080, 10.3.0.1:80 to 10.3.0.1:8080, etc..
>>
>> OK, so basically you just want to rewrite the port number. An easier
>> way to do this without iterating through all addresses would be to
>> change userspace and the kernel so you can create REDIRECT rules
>> without the IP_NAT_RANGE_MAP_IPS flag. That won't work for forwarded
>> packets, but its the simplest solution for the case you describe.
>
> Isn't TPROXY the right thing here if all you want is changing the port
> of delivery? :-)
TPROXY does more than changing the port number. Being able to
specify port-only redirect rules sounds useful to me in any
case.
next prev parent reply other threads:[~2010-07-16 14:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-16 10:00 [PATCH] ipt_REDIRECT: only change dest-ip if not local ip Bas van Sisseren
2010-07-16 12:21 ` Patrick McHardy
2010-07-16 12:42 ` Bas van Sisseren
2010-07-16 12:49 ` Patrick McHardy
2010-07-16 14:56 ` Jan Engelhardt
2010-07-16 14:58 ` Patrick McHardy [this message]
2010-07-16 15:14 ` Bas van Sisseren
2010-07-16 19:18 ` Jan Engelhardt
2010-07-19 8:02 ` Bas van Sisseren
2010-07-16 13:03 ` Pascal Hambourg
2010-07-16 12:42 ` Pascal Hambourg
2010-07-16 13:23 ` Bas van Sisseren
2010-07-16 15:04 ` Pascal Hambourg
2010-07-16 15:21 ` Bas van Sisseren
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=4C40738F.900@trash.net \
--to=kaber@trash.net \
--cc=bas@quarantainenet.nl \
--cc=jengelh@medozas.de \
--cc=netfilter-devel@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.