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



On Wed, 2015-09-30 at 12:25 -0400, Derek Atkins wrote:
Dan,

Dan Williams <dcbw redhat com> writes:

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.

I.e., just to make sure I understand correctly, in order to get what I
want I should just create /etc/sysconfig/network-scripts/ifcfg-eth0:0
and let NM manage my alias that way?  Do I need to do anything special
to get NM to notice it, or it will do so automagically on the next
restart/reboot?

There are some alias examples here, FWIW:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/settings/plugins/ifcfg-rh/tests/network-scripts

And all that's really required is "nmcli con reload", you shouldn't ever
need to restart NetworkManager to get config changes taken into account.

Dan



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