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


I've got an esoteric NM question.  I've got two distinct networks that
share an ethernet fabric (poor man's vlans).  I have a F22 server that I
want to put on both networks.  It's currently configured to use DHCP for
the primary network (and my DHCP server provides a static address).

AFAICT there's really no way to get DHCP to provide two addresses, so
I'd like to set up a secondary IP statically using nmcli (I did say this
was a server, right?)

Basically I want to automate NM doing, effectively:

  ifconfig eth0:0 192.168.x.y

I know how I would do this using the old /etc/sysconfig/networking
config files, but I have NO CLUE how to do with with nmcli.  I've spent
the last hour googling and reading about it and still haven't figured it
out, yet.  I suppose I could just add something to rc.local, but I'd
rather do it the "right way" (and maybe learn something along the way).

I know I can add a second IP to eth0 via:

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

But I have no idea how this would interact with the primary address
being obtained by DHCP.

So, what nmcli magic command(s) do I need to run to do what I want?


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord MIT EDU                        PGP key available

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