You are not logged in.

#1 2013-08-16 17:52:43

bachtiar
Member
Registered: 2005-02-08
Posts: 65

Correct way of using DHCP on diskless system?

I have a diskless system with root filesystem mounted over NFS. My IP addresses are assigned via DHCP.

The IP is obtained early in boot process (in initrd), because obviously, it needs to communicate with NFS server to mount root filesystem.

However, when the systemd comes up some moments later, I have two problems:
- dhcpcd client service starts, and it asks for a IP lease eventhough IP has already been assigned => I end up with two IP addresses.
- udev service compains about being unable to rename network interface because it is in use. (It tries this because of rules for persistent network interface naming)

I am willing to sacrifice the udev rules if neccessary. But I need dhcpcd running, because it must manage lease expiration and renewal. Without that, the DHCP is essentially useless.

What is the correct way of dealing with DHCP configuration (IP/netmask/gateway/dns) if one uses NFS root? Ideally, udev/dhcpcd should honour network settings if the network was already configured when they start.

Last edited by bachtiar (2013-08-16 17:52:57)

Offline

#2 2013-08-17 00:46:42

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Correct way of using DHCP on diskless system?

It gets the first address from the pxelinux.0, another one is usually handed down after it boots, but sometimes it reuses it again. 
Usually what happens on a diskless system is it tries to use the dhcpcd lease from the last diskless workstation (or possibly reuses the same one it gets from pxelinux.0).  But it has enough logic built into that it looks for another unique address for the next diskless workstation. 
Do you have your pxeclient.cfg/default appended options set correctly to be ip=::::::dhcp? 
Of course from the diskless wiki:

label archxx
kernel archxx/boot/vmlinuz-linux
append init=/usr/lib/systemd/systemd initrd=archxx/boot/initramfs-linux.img root=/dev/nfs rootfstype=nfs nfsroot=xx.xx.xx.xx:/srv/tftp/archxx,v3,rsize=16384,wsize=16384 ip=::::::dhcp

I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB