Re: How to configure a DHCP + (2nd) Static address (eg on eth0+eth0:0)?



On Wed, 2015-09-30 at 10:15 -0400, Derek Atkins wrote:
Andrei,

Andrei Borzenkov <arvidjaar gmail com> writes:

29.09.2015 20:54, Dan Williams пишет:

Basically I want to automate NM doing, effectively:

   ifconfig eth0:0 192.168.x.y

Don't do this with interface aliases; the kernel is perfectly capable of
using more than one address on the same interface.  Simply do:

ip addr add 192.168.x.y/24 dev eth0

and magically you'll have two.



This makes addresses invisible in ifconfig output and that may confuse
legacy software (I know about at least one such case). Adding "label
xxx" will emulate legacy aliases enough to make them appear as
"normal" interface.

Could you explain more detail on how to add "label xxx" to the nmcli
command (which you inconveniently cut out of your reply, so I've
included it below)?  I cannot find any reference to "label" in the nmcli
documentation.

  nmcli con mod "Wired connection 1" +ipv4.addresses "192.168.x.y/24"

If you really do need address labels (eg, interface aliases) then
NetworkManager has limited support for them.  If you don't truly need
address labels, then I wouldn't use them.  Anyway, NM supports address
labels, but only when they are set via ifcfg "alias" files.  They
currently cannot be added via nmcli or set via the 'keyfile' plugin,
though that's just a case of "didn't implement yet" rather than anything
else.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]