I'm working on a Mac OS X port of SystemImager, an automated software installation and distribution tool.
The first thing I needed was a configurable DHCP server that supports NetBooting.
I suspect bootp (aka DHCP) on Mac OS X Server does this, but I've never been able to figure out how to create statically assigned IP addresses assigned by MAC address. Gave up and replaced the built in bootp with the standards-based dhcpd from ISC, modified to support NetBoot, configured to sit cozy on Mac OS X.
Below are the directions, for anyone that might find it useful.
[Editor's note: I have not tested this hint myself, as it's well beyond my skill set! However, I don't see anything malicious in the script, and it might prove useful to some of you, so here it is...]
% curl -O ftp://ftp.isc.org/isc/dhcp/dhcp-3.0pl1.tar.gz
% tar zxvf dhcp-3.0pl1.tar.gz
% curl -O http://software.harrisonburg.k12.va.us/linux/The above is shown on two lines; enter it as one with no spaces.
src/dhcp-3.0-macnb-0.4.patch
% mv dhcp-3.0pl1 dhcp-3.0-new
% patch -p1 < dhcp-3.0-macnb-0.4.patch
% cd dhcp-3.0-new
% ./configure
% make
% sudo make install
% touch /var/db/dhcpd.leases
% mkdir /Library/StartupItems
% mkdir /Library/StartupItems/DHCP
% mkdir /Library/StartupItems/DHCP/Resources
% mkdir /Library/StartupItems/DHCP/Resources/English.lproj
#!/bin/sh
##
# DHCP
##
. /etc/rc.common
StartService ()
{
if [ "${DHCP:=-NO-}" = "-YES-" ]; then
if ! pid=$(GetPID dhcpd); then
ConsoleMessage "Starting DHCP services"
/usr/sbin/dhcpd en0
fi
fi
}
StopService ()
{
if pid=$(GetPID dhcpd); then
ConsoleMessage "Stopping DHCP services"
kill -TERM "${pid}"
else
echo "dhcpd is not running."
fi
}
RestartService ()
{
if pid=$(GetPID sendmail); then
ConsoleMessage "Restarting DHCP services"
kill -HUP "${pid}"
else
StartService
fi
}
RunService "$1"
{
Description = "DHCP server";
Provides = ("DHCP");
Requires = ("Network");
Uses = ("Disks", "Network Time");
OrderPreference = "None";
}
<?xml version="1.0" encoding="UTF-8"?>The "Doctype" line has been split in two for easier display; enter it as one line with no spaces.
<!DOCTYPE plist SYSTEM "file://localhost/System/
Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Starting DHCP services</key>
<string>Starting DHCP services</string>
<key>Stopping DHCP services</key>
<string>Stopping DHCP services</string>
<key>Restarting DHCP services</key>
<string>Restarting DHCP services</string>
</dict>
</plist>
% chown -R root.wheel /Library/StartupItems/DHCP
% chmod -R 755 /Library/StartupItems/DHCP
% chmod 644 /Library/StartupItems/DHCP/StartupParameters.plist
default-lease-time 2592000;
max-lease-time 2592000;
ddns-update-style ad-hoc;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option routers 192.168.2.1;
option domain-name-servers 192.168.2.1, 204.127.202.19;
option domain-name "home.com";
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.2 192.168.2.100;
}
group {
host tibook {
hardware ethernet 00:30:65:10:76:0c;
fixed-address 192.168.2.4;
}
}
% sudo SystemStarter start DHCP
Mac OS X Hints
http://hints.macworld.com/article.php?story=20021017055337617