You are not logged in.
Every time I reboot the Arch Linux installation ISO, the computer is assigned a new IP address.
The DHCP server is a Raspberry Pi running dnsmasq on Raspbian.
My goal is for the archiso system to always be assigned the same IP address, specifically 192.168.0.62. (I do not want a static IP address. I do want the address to be assigned via DHCP, as sometimes I boot this same archiso ISO file on other networks.)
From /var/lib/misc/dnsmasq.leases after the first boot:
1601984340 [snip_mac_address] 192.168.0.62 archiso ff:56:50:4d:98:00:02:00:00:ab:11:7b:df:a4:3a:b7:fd:8e:0b
After the second boot:
1601984340 [snip_mac_address] 192.168.0.62 * ff:56:50:4d:98:00:02:00:00:ab:11:7b:df:a4:3a:b7:fd:8e:0b
1601984418 [snip_mac_address] 192.168.0.81 archiso ff:56:50:4d:98:00:02:00:00:ab:11:e6:f4:3b:1b:d8:63:18:52
After the third boot:
1601984340 [snip_mac_address] 192.168.0.62 * ff:56:50:4d:98:00:02:00:00:ab:11:7b:df:a4:3a:b7:fd:8e:0b
1601984418 [snip_mac_address] 192.168.0.81 * ff:56:50:4d:98:00:02:00:00:ab:11:e6:f4:3b:1b:d8:63:18:52
1601984512 [snip_mac_address] 192.168.0.82 archiso ff:56:50:4d:98:00:02:00:00:ab:11:f5:c6:f5:14:18:b4:6f:f6
The snipped mac address is always the same, as I am always booting the Arch ISO on the same system.
Excerpt from /var/log/syslog on the DHCP server (corresponding to the second above boot):
Oct 5 16:40:15 raz dnsmasq-dhcp[10494]: not using configured address 192.168.0.62 because it is leased to [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: DHCPDISCOVER(eth0) [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: DHCPOFFER(eth0) 192.168.0.81 [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: not using configured address 192.168.0.62 because it is leased to [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: DHCPDISCOVER(eth0) [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: DHCPOFFER(eth0) 192.168.0.81 [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: DHCPREQUEST(eth0) 192.168.0.81 [snip_mac_address]
Oct 5 16:40:18 raz dnsmasq-dhcp[10494]: DHCPACK(eth0) 192.168.0.81 [snip_mac_address] archiso
I suspect that the long hex string at the end of each line of dnsmasq.leases is the DUID (DHCP unique identifier) associated with each request, and that the DUID is changing on each reboot.
Consequently, I suspect I need to find a way of doing one of the following:
1) Suppress the DUID so that the DUID is not included with the DHCP request.
2) Stabilize the DUID so that the DUID does not change across reboots.
3) Reconfigure dnsmasq so that it ignores the DUID.
If anyone can provide instructions as to how to stabilize the DHCP-assigned IP address across reboots, I would appreciate it.
I do already know how to build a custom Arch ISO file. I just need to know how to tweak the config files on my custom ISO.
Thank you.
Last edited by mpb (2020-10-06 02:41:44)
Offline
There is nothing to do in archiso to get what you want as you claim to *not* want to configure it for a static IP. If you want the client to use dhcp (dynamic host configuration protocol), then you need to configure the server to assign a predefined IP address to the MAC address of the archiso client. This is trivial to do following dnsmasq documentation, but this would be done on the raspbian system, so you'll need to seek help on that distro's forums.
Hint: this set up is explicitly covered in our wiki page for dnsmasq (search for the single instance of "MAC" on the page). I suspect it'd work the same on raspbian, but if it doesn't, you'll have to ask on their forums how to do it.
Last edited by Trilby (2020-10-06 01:23:12)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I have found a solution. The DUID can be set in /etc/systemd/networkd.conf.
I set DUIDType=vendor, and DUIDRawData to a hex string. After that, the IP address is stable across reboots.
More info here:
https://unix.stackexchange.com/q/456763
https://www.man7.org/linux/man-pages/ma … onf.5.html
@Trilby - I had already configured dnsmasq to assign the same IP address to the host "archiso". However, this did not yield a stable IP address as the DUID was changing on every reboot.
Last edited by mpb (2020-10-06 01:51:33)
Offline
I had already configured dnsmasq to assign the same IP address to the host "archiso". However, this did not yield a stable IP address as the DUID was changing on every reboot.
But the MAC address wasn't changing which is what I was directing to. But if ensuring the DUID is the same works, then feel free to edit the first post to prepend [SOLVED] to the title.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
But the MAC address wasn't changing which is what I was directing to.
For reasons that I will not explain here, for most of my hosts I have configured dnsmasq to assign IP addresses by hostname, not by MAC address.
In the particular case of my custom Arch ISO image, I also intentionally want to assign the IP address based on hostname. Specifically, I do want to be able to use the same ISO image on different machines (but not simultaneously) on my LAN, and my goal is for the Arch ISO to always get the same IP address (when used on my LAN).
Thank you for the assistance.
Offline