0

I have recently had to replace my motherboard (don't ask, if you don't want to see a grow-up cry ;-) ) New motherboard -> new ethernet -> new MAC address -> new IP address via DHCP. As I had a fixed IP address 172.16.0.1 assigned to this host, the newly assigned IP address 172.16.210.213 doesn't fit, so I quickly changed the entry on my DHCP server (a Zyxel 5501 router) to reflect the new MAC address of the machine and rebooted but ... the machine got the bad IP address assigned again. It tried various things, eg deleting entries on my router, deleting various dhcp-related files on my machine, restarting, stopping, deleting lease files, restarting ... all to no avail I now restarted the dhclient with "-d" to see what happens and the debug output shows

Listening on LPF/virbr0-nic/52:54:00:28:48:36
Sending on   LPF/virbr0-nic/52:54:00:28:48:36
Listening on LPF/virbr0/52:54:00:28:48:36
Sending on   LPF/virbr0/52:54:00:28:48:36
Listening on LPF/wlp8s0/28:b2:bd:f8:1f:bf
Sending on   LPF/wlp8s0/28:b2:bd:f8:1f:bf
Listening on LPF/eno1/40:8d:5c:b7:02:a0
Sending on   LPF/eno1/40:8d:5c:b7:02:a0
Sending on   Socket/fallback
DHCPDISCOVER on virbr0-nic to 255.255.255.255 port 67 interval 3 (xid=0xbedfb46e)
DHCPDISCOVER on virbr0 to 255.255.255.255 port 67 interval 3 (xid=0x7c063c6f)
DHCPDISCOVER on wlp8s0 to 255.255.255.255 port 67 interval 3 (xid=0x139d1c0c)
send_packet: Network is down
dhclient.c:2098: Failed to send 300 byte long packet over wlp8s0 interface.
DHCPREQUEST of 172.16.0.1 on eno1 to 255.255.255.255 port 67 (xid=0x112759d7)
receive_packet failed on wlp8s0: Network is down
DHCPNAK from 172.16.255.254 (xid=0xd7592711)
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf
DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 3 (xid=0xaa7e090e)
DHCPDISCOVER on wlp8s0 to 255.255.255.255 port 67 interval 3 (xid=0x139d1c0c)
send_packet: Network is down
dhclient.c:2098: Failed to send 300 byte long packet over wlp8s0 interface.
DHCPDISCOVER on virbr0-nic to 255.255.255.255 port 67 interval 7 (xid=0xbedfb46e)
DHCPDISCOVER on virbr0 to 255.255.255.255 port 67 interval 7 (xid=0x7c063c6f)
DHCPREQUEST of 172.16.210.213 on eno1 to 255.255.255.255 port 67 (xid=0xe097eaa)
DHCPOFFER of 172.16.210.213 from 172.16.255.254
DHCPACK of 172.16.210.213 from 172.16.255.254

So, I assume that the dhclient gets this bad address from somewhere and requests this bad address from the router who graciously assigns it to him. But I can't, for the heck of it, find out where this bad IP address is stored! How can I convince my machine to request 172.16.0.1 and not 172.16.210.213?

I'm currently running Kubuntu 16.04 and ... yes, I know it's outdated, an upgrade is in the works.

7
  • 1
    dhclient gets the address from a dhcp-server, probably your router. But why do you have a fioxed ip-addres when you are using dhcp / dhclient ? dhcp are used for dynamic addresses. If you configure a fixed address it must be outside the range handled by the dhcp-server.
    – Soren A
    Feb 3, 2021 at 9:19
  • I have done a few reorganizations of this network, eg changing IP addresses and netmasks. Also we have a fairly dynamic set of users (family members who come to visit) and I also have a few devices which insist on using DHCP, I set up EVERYTHING as DHCP. I can't configure the dynamic DHCP range on the Zyxel: I can only set THE range and if I exclude the fixed range, it will be ignored completely. Whyt I don't understand is why my route DHCPNAKs my 172.16.0.1 request :-( Feb 3, 2021 at 9:55
  • Maybe it DHCPNAKs because it reserved to a MAC address in the dhcp server on the Zyxel ? Mixing static and dynamic ip's in same range is asking for trouble.
    – Soren A
    Feb 3, 2021 at 11:18
  • No. The MAC address as recorded in the router is the same as that from the local machine. And I do not do static IP address assignment, with a very few exceptions where the device itself does not support DHCP and there I add the device to the host list nonetheless to document this. As I said ... I'm just wondering where dhclient gets the the bad IP address from to request it from the DHCP server on the router. Feb 3, 2021 at 12:14
  • @SorenA you can perfectly configure a static IP assignment in the DHCP server. Thus the server will always assign the same IP address to the particular MAC (on some routers it is called "DHCP reservation"). So the address is not "static" in sense that it is statically configured on the computer. It assigned by DHCP, but it is effectively "static", because DHCP server always assigns the same IP address to that computer. That's probably what OP meant. I configure all important devices in my home network this way. Those that appear randomly from time to time are "truly" dynamic.
    – raj
    Feb 3, 2021 at 20:54

1 Answer 1

0

Explaining DHCP:

Some system, identified only by its MAC address (on the Data Link level of the OSI model) requests an IP address from the broadcast address (255.255.255.255).

The DHCP Server returns an IP address, either the IP address it assigned to the MAC address last time, or an IP address from the pool. The DHCP server remembers this MAC to IP Address assignment.

In your case, the DHCP server had the Old MAC to IP Address mapping stored in its cache. Because you reserved the IP Address, it is not available for other assignment.

When the New MAC asked, it was given an IP Address from the pool. This MAC to IP Address mapping is remembered.

Make sure your DHCP configuration is accurate, up-to-date, and saved. Then. power cycle your router. This will restart the DHCP server, and make it forget all the MAC to IP Address mappings, except the ones you've reserved.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .