Thanks to all for their input. The blame seems to be with Ubuntu. I fired up a CentOS 6 virtual machine (was going to use a CentOS 7 VM but I snagged the 6 by mistake - been messing with this for too long) and did some release/renew experimenting. I observed this after issuing the dhclient -r command
Code:
[root@localhost Desktop]# dhclient -v
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth1/00:50:56:3f:89:60
Sending on LPF/eth1/00:50:56:3f:89:60
Sending on Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 5 (xid=0x6238e13b)
DHCPOFFER from 10.42.0.1
DHCPREQUEST on eth1 to 255.255.255.255 port 67 (xid=0x6238e13b)
DHCPACK from 10.42.0.1 (xid=0x6238e13b)
bound to 10.42.0.29 -- renewal in 1704 seconds.
The VM had the address 10.42.0.124 before the release. The dhcp server (dnsmasq on the Pi in fact) offered 10.42.0.29 and it was accepted and bound to the interface - as it should have. I then tried this on an Ubuntu 16.04 VM. After releasing the address I observed
Code:
root@ubuntu:/home/moe/Desktop# dhclient -v
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/ens33/00:0c:29:84:94:24
Sending on LPF/ens33/00:0c:29:84:94:24
Sending on Socket/fallback
DHCPDISCOVER on ens33 to 255.255.255.255 port 67 interval 3 (xid=0xee4aca5f)
DHCPREQUEST of 10.42.0.223 on ens33 to 255.255.255.255 port 67 (xid=0x5fca4aee)
DHCPOFFER of 10.42.0.223 from 10.42.0.1
DHCPACK of 10.42.0.223 from 10.42.0.1
RTNETLINK answers: File exists
bound to 10.42.0.223 -- renewal in 1595 seconds.
The offending line seems to be:
DHCPREQUEST of 10.42.0.223 on ens33 to 255.255.255.255 port 67 (xid=0x5fca4aee)
It seems that the client is requesting its old address. Not what I want to do. I then moved to the Pi and found the same behavior. I searched for the Pi's old address and found it here
Code:
grep -R '71.48.5.144' /var/ *.lease
/var/lib/NetworkManager/dhclient-f49cc2d3-e9cf-3771-b94d-d41a4856d20a-enxb827ebd88666.lease: fixed-address 71.48.5.144;
/var/lib/NetworkManager/dhclient-f49cc2d3-e9cf-3771-b94d-d41a4856d20a-enxb827ebd88666.lease: fixed-address 71.48.5.144;
grep -R '71.48.5.144' /var/ *.leases
/var/lib/dhcp/dhclient.leases: fixed-address 71.48.5.144;
/var/lib/dhcp/dhclient.leases: fixed-address 71.48.5.144;
I then whacked the offending files with a big hammer
Code:
rm /var/lib/NetworkManager/dhclient*.lease
rm /var/lib/dhcp/dhclient.leases
I then asked for a new address
Code:
root@taylor23:/home/ken# dhclient -v enxb827ebd886666
enxb827ebd886666: interface name too long (is 16)
If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..
exiting.
Which is BS
Code:
root@taylor23:/home/ken# nmcli dev status
DEVICE TYPE STATE CONNECTION
enx0050b61c0065 ethernet connected Wired connection 2
enxb827ebd88666 ethernet connected Wired connection 1
lo loopback unmanaged --
But this is Ubuntu so I omitted the interface name.
Code:
root@taylor23:/home/ken# dhclient -v
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/enx0050b61c0065/00:50:b6:1c:00:65
Sending on LPF/enx0050b61c0065/00:50:b6:1c:00:65
Listening on LPF/enxb827ebd88666/b8:27:eb:d8:86:66
Sending on LPF/enxb827ebd88666/b8:27:eb:d8:86:66
Sending on Socket/fallback
DHCPREQUEST of 10.42.0.224 on enx0050b61c0065 to 255.255.255.255 port 67 (xid=0x7f3003bf)
DHCPREQUEST of 71.48.5.152 on enxb827ebd88666 to 255.255.255.255 port 67 (xid=0x59791fdf)
DHCPACK of 10.42.0.224 from 10.42.0.16
RTNETLINK answers: File exists
bound to 10.42.0.224 -- renewal in 32593 seconds.
Low and behold I had a new IP address
Unfortunately this also reset the LAN side interface (which has a manually set address) and I lost connection with the Pi. My new reset script looks like
Code:
#!/bin/bash
sudo dhclient -r enxb827ebd88666
sudo rm /var/lib/NetworkManager/dhclient*.lease
sudo rm /var/lib/dhcp/dhclient.leases
sudo shutdown -r now
Not sure why the dhclient -v -r works with the long winded interface name and dhclient -v does not. Something to look into another time. Bottom line I can now change my Internet IP address at will. Now if only I could remember why I wanted to do so
Ken