From: Lukas Tribus <luky-37@hotmail.com>
To: <david+ml@madore.org>, <netdev@vger.kernel.org>
Subject: RE: assigning an entire subnet of addresses to an interface
Date: Sun, 3 Feb 2013 22:45:45 +0100 [thread overview]
Message-ID: <DUB107-W70CD0C5839AA44142F48CED020@phx.gbl> (raw)
In-Reply-To: <20130203205124.GA13738@aldebaran.madore.org>
The feature you are looking for is called "Transparent proxy support" or
TPROXY, and is in the kernel since 2.6.28.
This allows an application to bind to any address and handle that traffic.
One of the applications supporting this feature is HAproxy:
http://cbonte.github.com/haproxy-dconv/configuration-1.5.html#5-transparent
> Date: Sun, 3 Feb 2013 21:51:24 +0100
> From: david+ml@madore.org
> To: netdev@vger.kernel.org
> Subject: assigning an entire subnet of addresses to an interface
>
> Dear list,
>
> Is there a way to assign an entire subnet of (typically IPv6)
> addresses to an interface? For example, I'd like to assign the entire
> 2001:db8:f00f::/48 prefix to eth42 without actually running 2^80
> separate "ip addr add" commands.
>
> I'm aware that (with sufficiently recent kernels) one can do this:
>
> ip -6 route add local 2001:db8:f00f::/48 dev lo
>
> - which will cause packets received for any address in this subnet to
> be handled locally. But that doesn't really answer my question,
> because this does not allow local processes to bind to any desired
> address in the subnet (e.g., running "socat
> 'TCP6-LISTEN:9876,bind=[2001:db8:f00f::3141:5926]'" fails with
> EADDRNOTAVAIL).
>
> Now apparently Linux _does_ have features which allow a process to
> bind to any desired address in a subnet, since this is the case for
> the IPv4 127.0.0.0/8 standard loopback (I can run "socat
> 'TCP-LISTEN:9876,bind=[127.1.2.3]' -" without error). In a naïve
> move, I tried to reproduce the output of ip addr show for the
> 127.0.0.0/8 subnet as input, but failed (there's an extra word "lo" in
> the output that ip does not allow back as input). Is this because
> this subnet is really magical to the kernel, or because ip input
> parsing is incomplete, or for some other reason?
>
> If the feature is not presently available in Linux, is there some hope
> that it eventually will be? How hard would it be to add it?
>
> Thanks in advance,
>
> --
> David A. Madore
> ( http://www.madore.org/~david/ )
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-02-03 21:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-03 20:51 assigning an entire subnet of addresses to an interface David Madore
2013-02-03 21:45 ` Lukas Tribus [this message]
2013-02-03 22:00 ` David Madore
2013-02-03 22:35 ` David Madore
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=DUB107-W70CD0C5839AA44142F48CED020@phx.gbl \
--to=luky-37@hotmail.com \
--cc=david+ml@madore.org \
--cc=netdev@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