[Nottingham] Gentoo network alias syntax, or "ip" add a label...

Martin martin at ml1.co.uk
Sun Oct 9 11:34:44 UTC 2011


On 8 October 2011 23:12, Martin <martin at ml1.co.uk> wrote:
> Folks,
>
> OK, I seem to have come unstuck with the Gentoo OpenRC syntax for the
> simple task of merely putting two IP addresses onto the same ethernet
> interace...
>
> So, I have eth0, and merely wish to assign 192.168.1.8 and 192.168.2.8
> and call them eth0 and eth0:2 respectively.
>
> Using:
>
> config_eth0=(
> "192.168.1.8/24"
> "192.168.2.8/24"
> )
[---]
> So...
>
> What's the magic to also get the second ip address labelled with an
> "eth0:2" ? (Or to get ifconfig to see it exists?)

I'm suspicious the Gentoo setup doesn't support that.

Note:

help configuring eth0:0 alias interface in openrc
http://forums.gentoo.org/viewtopic-t-797169-start-0.html


> Or can "ip" be used to just add a label to an existing interface address?

Anyone for that one? Or, for an existing address, must you remove and
then re-add with the eth0:x label ?


> ... And the documentation for Gentoo OpenRC appears to be rather 'lacking'...

What was it that Richard Stallman said about good documentation and freedom?!...


I'm using Shorewall and there are good examples for using a single
physical interface across multiple subnets given on:

Routing on One Interface
http://www.shorewall.net/Multiple_Zones.html

What isn't described is that you must also take care over what address
used by the interface when sending data packets. Hence, depending on
what you're doing, you will need to use "ip tables" to appropriately
set the source address for anything outgoing on that interface.

The Linux kernel does exactly the right thing for when you have
separate physical interfaces. Why not so for multiple aliases on a
single physical interface?...


Hope that helps for any others having similar fun...

Cheers,
Martin



More information about the Nottingham mailing list