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

Martin martin at ml1.co.uk
Sat Oct 8 22:12:36 UTC 2011


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"
)

in "/etc/conf.d/net", and doing a "ln -s /etc/init.d/net.lo
/etc/init.d/net.eth0" and "rc-update add net.eth0 default"  works fine
except that only the first address gets an ip label of eth0. The
second is there and it is usable, but with no label.

ip addr show

shows both addresses. However, ifconfig only lists the one address for eth0.

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?)

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


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

Cheers,
Martin



More information about the Nottingham mailing list