I've read the documentation as well as the source code. It appears FAI does not support Static network booting to the NFS root when a DHCP server isn't available on that subnet. Additionally the documentation is wrong for setting static IP's, as well as inconsistent with other parts of the code.<div>
<br></div><div>1. Static IP address syntax</div><div><br></div><div>The doc says:</div><div><div>ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf></div>
</div><div><br></div><div>However this still tries to DHCP. If I set this and have it do a non-nfs installation the /etc/network/interfaces on the host gets written as</div><div><br></div><div>iface <IPADDR> inet static</div>
<div> address (just blank)</div><div><br></div><div>So it's putting the IP where the DEVICE should be, and not setting an IP.</div><div><br></div><div>The code uses the /bin/ipconfig in the initrd.</div><div><br></div>
<div>Strings shows that this actually reads in the ip= variables as:</div><div>DEVICE:IPV4ADDR:IPV4BROADCAST:IPV4NETMASK:IPV4GATEWAY:IPV4DNS0:IPV4DNS1:HOSTNAME:DNSDOMAIN:NISDOMAIN:ROOTSERVER:ROOTPATH:filename</div><div><br>
</div><div>This should be consistent so if you are doing DHCP and the server doesn't set some vars you can do ip=eth0:::::::HOST::NIS:ROOTSERVER:PATH:filename</div><div><br></div><div>Also, the code does this:</div><div>
<br></div><div><div><div> for ifline in ${parsed}</div><div> do</div><div> ifname="$(echo ${ifline} | cut -f1 -d ':')"</div><div>
ifaddress="$(echo ${ifline} | cut -f2 -d ':')"</div><div> ifnetmask="$(echo ${ifline} | cut -f3 -d ':')"</div><div> ifgateway="$(echo ${ifline} | cut -f4 -d ':')"</div>
<div><br></div></div><div>So ip=DEVICE:IPADDR:MASK:GATEWAY here. Not DEV:IP:BROADCAST:MASK:GW as above. If static works I'm not certain some variables would be set correctly.</div></div><div><br></div><div>2. DHCP Issues</div>
<div>However, if I do an NFS install it still tries to DHCP. I set the 'nodhcp' flag, and it still tries to dhcp.</div><div><br></div><div>Looking at the code it unsets the DHCP flag, but ipconfig doesn't seem care about this. There should be a separate stanza for device configuration depending on the DHCP flag to configure the device statically. </div>
<div><br></div><div>Additionally, the 'nodhcp' flag kind of gets overwritten with this in the scripts/live and forces DHCP even if nodhcp and a static IP are set :</div><div><br></div><div><div> # sort of compatibility with netboot.h from linux docs</div>
<div> if [ -z "${NETBOOT}" ]</div><div> then</div><div> if [ "${ROOT}" = "/dev/nfs" ]</div><div> then</div><div> NETBOOT="nfs"</div>
<div> export NETBOOT</div><div> elif [ "${ROOT}" = "/dev/cifs" ]</div><div> then</div><div> NETBOOT="cifs"</div><div>
export NETBOOT</div><div> fi</div></div><div><br></div><div>Then in the networking script:</div><div><br></div><div><div> if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]</div>
<div> then</div><div> # default, dhcp assigned</div><div> method="dhcp"</div><div> else</div><div> # make sure that the preconfigured interface would not get reassigned by dhcp</div>
<div> # on startup by ifup script - otherwise our root fs might be disconnected!</div><div> method="manual"</div><div> fi</div></div><div><br></div><div>And it doesn't try to set statically if using /dev/nfs like above</div>
<div><br></div><div><div>if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]</div><div>then</div><div> parsed=$(echo "${STATICIP}" | sed -e 's/,/ /g')</div>
<div><br></div><div> for ifline in ${parsed}</div><div> do</div><div> ifname="$(echo ${ifline} | cut -f1 -d ':')"</div><div><br></div></div><div><br></div><div>As we can see here if we use NFS it forces DHCP per the above.</div>
<div><br></div><div>This tells FAI that - hey, if you are doing a network install, it HAS to be DHCP. No bueno.</div><div><br></div><div>I'll be modifying my code on this end (hacking). Let me know if I'm missing something and need to change my config for a static network isntall.</div>
<div><br></div><div><br></div><div><br></div>