kilowatt
mach-o mach-o man
Ok, this is for those of you who want to set up a DHCP server to allow other computers to grab ip and dns information off of your computer. This is especially useful if you have a small private network and wish to automate the addition of other computers.
For this howto, basic terminal skills and admin-level access are required. Its not hard, don't worry
BTW, if you allready have a dhcp server on the network, turn it off first
First, go to the official DHCP web page and have a look around:
http://isc.org/products/DHCP/
here's the source code - download it by control-clicking the link and selecting 'save as...'
ftp://ftp.isc.org/isc/dhcp/dhcp-latest.tar.gz
Now, logged in as an admin-level user, open the Terminal (located in /Applications/Utilities)
type the following commands:
thats it! now you have the binaries for the server, as well as some dhcp-tweaking utilities installed. If you're nuts, you can simply:
in the dhcp-3.0 directory - but be warned - you are replacing existing Mac OS X dhcp client files as well, and I don't recommend this. (If you do this, and it works though, please post, I'm sure many would like to update their dhcp clients too).
Now, we have to configure the server. Still to go is making it startup on startup
cd into /etc
cd /etc
ok, now type sudo pico dhcpd.conf
This is the dhcpd configuration file (duh).
Here is a URL I found extremely helpful at this point: http://www.linux-mag.com/2000-04/networknirvana_03.html
the next page in the url is also helpful.
For the impatient, here is a copy of my /etc/dhcpd.conf file - just paste it into pico.
if you're in pico like me (vi sucks btw) press control-o, then hit return to save the file.
ok, now before we start the dhcpd, we need to touch up a fake database file so that dhcpd will think its been ran before. I think its rather stupid that we have to do this, and there's probably a way around it, but for now, whatever
okey dokey, now we're set. Here's how you start the server:
sudo dhcpd &
more to follow on starting it automatically and netinfo integration.
For this howto, basic terminal skills and admin-level access are required. Its not hard, don't worry
BTW, if you allready have a dhcp server on the network, turn it off first
First, go to the official DHCP web page and have a look around:
http://isc.org/products/DHCP/
here's the source code - download it by control-clicking the link and selecting 'save as...'
ftp://ftp.isc.org/isc/dhcp/dhcp-latest.tar.gz
Now, logged in as an admin-level user, open the Terminal (located in /Applications/Utilities)
type the following commands:
Code:
cd /path/to/the/file/you/downloaded
tar -zxvf dhcp-latest.tar.gz
cd dhcp-3.0
./configure
make
[i]get food or something - takes about 3 mins to compile - oh btw, when prompted for a password, enter [b]your[/b] password[/i]
cd work.darwin
cd server
sudo make install
cd ../common
sudo make install
cd ../dhcpctl
sudo make install
cd ../opamip
sudo make install
Code:
sudo make install
Now, we have to configure the server. Still to go is making it startup on startup
cd into /etc
cd /etc
ok, now type sudo pico dhcpd.conf
This is the dhcpd configuration file (duh).
Here is a URL I found extremely helpful at this point: http://www.linux-mag.com/2000-04/networknirvana_03.html
the next page in the url is also helpful.
For the impatient, here is a copy of my /etc/dhcpd.conf file - just paste it into pico.
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 )
option domain-name-servers 192.168.1.140;
ddns-update-style ad-hoc;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.150 192.168.1.200;
default-lease-time 300000;
max-lease-time 350000;
option routers 192.168.1.1;
}
ok, now before we start the dhcpd, we need to touch up a fake database file so that dhcpd will think its been ran before. I think its rather stupid that we have to do this, and there's probably a way around it, but for now, whatever
Code:
sudo touch /var/db/dhcpd.leases
okey dokey, now we're set. Here's how you start the server:
sudo dhcpd &
more to follow on starting it automatically and netinfo integration.