View Single Post
  #14  
Old June 17th, 2006, 05:50 AM
chrispy987 chrispy987 is offline
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
chrispy987 is on a distinguished road
DHCPd Server on 10.4 (workstation)

Thanks to kilowatt for getting me started on this. My solution is pretty barbones, but it works for me.


1. Download the DHCP code from http://www.isc.org/.

2. Expand the package. I used /sbin as the directory.
sudo tar xcvf dhcp-X.XX

3. Change in to the new directory.

4. Build and install the package.
sudo ./configure
sudo make
sudo make install

5. Add dhcp.plist to /System/Library/LaunchDaemons
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>org.isc.dhcpd</string>
	<key>OnDemand</key>
	<false/>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/sbin/dhcpd</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>UserName</key>
	<string>root</string>
</dict>
</plist>
This is configured to launch on start up.

6. Configure dhcpd.conf
Here's a verison of what I used: Sample 1
Code:
## /etc/dhcpd.conf file 
## compiled by the infamous super-hacker unix guru kilowatt from macosx.com (you need this in the file for things to work :p )
## tweaked for fixed addresses by Chrispy.


option domain-name "Your_domain.com";
option domain-name-servers 66.66.77.88, 66.66.77.89;

##Check ddns?
ddns-update-style ad-hoc;


Authoritative;

##define the Subnet to be served.

subnet 192.168.1.0 netmask 255.255.255.0 {

##Define the DHCP address range to be served.

range 192.168.1.50 192.168.1.90;
default-lease-time 300000;
max-lease-time 350000;
option routers 192.168.1.1; 
}


## Fixed IP addresses the name isn't too important.  Just match the MAC address (hardware ethernet) the fixed-address to use.  Watch the semicolons.
host comp1 {
  hardware ethernet 00:11:22:33:44:55;
  fixed-address 192.168.1.2;
}

host comp2 {
  hardware ethernet 00:aa:bb:cc:dd:ee;
  fixed-address 192.168.1.3;
}

host comp3 {
  hardware ethernet 00:ee:dd:cc:bb:aa;
  fixed-address 192.168.1.4;
}

host router {
  hardware ethernet 00:aa:11:bb:22:cc;
  fixed-address 192.168.1.1;
}

Now dhcp should be availalbe using the service command, and you should be able to start and stop it normally. It should also launch at start up. If you want to turn it off, just edit the .plist.
Attached Files
File Type: txt dhcpd.conf_sample.txt (1.1 KB, 6 views)
File Type: txt dhcpd.conf_sample2.txt (3.2 KB, 4 views)
File Type: txt dhcp.plist.txt (436 Bytes, 7 views)
Reply With Quote