DHCP, Network Manager, Centos 7 – the curious case of two IPs working at the same time

Messing around with DHCP for the raspberry pi that’s going to be aggregating syslogs.

  • Raspberry Pi running 32 bit Centos 7;  primary interface addressed using DHCP.
  • I assigned it a static DHCP allocation, a different IP.
  • Restarted the NetworkManager service.
  • Nothing seemed to happen.
  • Logged out, logged back in (using the original IP.)
  • Still works.

I guess restarting Network Manager doesn’t restart the interfaces.

But ..

$ ssh root@
# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
         inet netmask broadcast

It did.  But hang on … the IP address is not the one I accessed the server with!

# ip a list
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet brd scope global noprefixroute dynamic eth0
       valid_lft 863962sec preferred_lft 863962sec
    inet brd scope global secondary noprefixroute dynamic eth0
       valid_lft 36515sec preferred_lft 36515sec

Of interest:

  1. It’s kept the old IP alive; I assume for the duration of the lease.
  2. A use case where ‘ip’ definitely trumps ‘ifconfig’. (old dog, new tricks)
  3. Not expected behaviour. Nice, but not expected.

Also: useful. Puppet is telling logging clients to use the old IP.  I need a bit of time to push around the IP change: Network Manager has handled the transition for me.

Original plan was a static IP for logging. But I hoped to keep DHCP for the host, because it turns out Network Manager is getting configured much better with DHCP than it would with a static IP.  The network manager module I’ve downloaded for Puppet isn’t as simple as it first looked, and needs some testing and investigation – so I’ve left that addition on the backlog.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s