|
#1
| ||||
| ||||
| HOW TO: Setup DHCPD (Server) on Mac OS X (Workstation)
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: Code: cd /path/to/the/file/you/downloaded tar -zxvf dhcp-latest.tar.gz cd dhcp-3.0 ./configure make get food or something - takes about 3 mins to compile - oh btw, when prompted for a password, enter your password 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 sudo dhcpd & more to follow on starting it automatically and netinfo integration.
__________________ irc.lfnet.net #kilonet -+=join in=+- Quote:
Audio Engineer - ProTools and Logic Pro Certified. FCC Licensed RF Technician Last edited by kilowatt; March 1st, 2002 at 01:40 PM. |
|
#2
| ||||
| ||||
|
updates: 1) every /etc/dhcpd.conf file on the internet is wrong - type mine *exactly* as it appears caus dhcpd is very picky apparently. Especially important is the semi-colin 2) To start the dhcpd server on an interface other than your default gateway (which is highly desireable on dual-interface configurations used as an internet gateway), start dhcpd like this: Code: sudo dhcpd en1 3) the man page for dhcpd (man dhcpd) is wonderful. Stop by there before you search yahoo or google. enjoy the dhcp server, please ask if you have any questions. Oh, and btw, adjust the config file to your preferences - if you don't have a dns server at 192.168.1.140, for example, don't say you have one (but put your isp's dns server there). Last edited by kilowatt; March 1st, 2002 at 02:27 PM. |
|
#3
| ||||
| ||||
| Startup Script
ok, ate some food, read some of 'An AIX Companion" (circa 1994 written by David L. Cohn), banged my head against the wall, read some more, and came up with a macintosh startup script. Pretty cool, huh? ok, so here's what to do: in the terminal as an admin-level user: Code: cd /Library mkdir StartupItems skip that step if its allready there - check by typing ls sudo chown root:admin StartupItems if you trust all your wheel (admin) users to be smart people, you can leave it owned to wheel (the default) ![]() and move it and unstuff: Code: sudo mv ~/Downloads/dhcpd-startup.zip . sudo unzip dhcpd-startup.zip sudo rm dhcpd-startup.zip it should create a directory called 'dhcpd'. Poke around in it to see how it works. If you want, you can do this in /System/Library/StartupItems, but apple requests that you put it in /Library so that it isn't confused with apple's startup stuff. Thanks to Yoshi, IckyShuff, twyg and Julian for putting up with me and supporting this in #macintosh - without them this would not be here. btw, admin, can you allow us to post .tar.gz files? I had to learn how to use the 'zip' command (which was incredibly hard) and I had to figure out that zip -x doesn't unzip only unzip does |
|
#4
| |||
| |||
| Your ZIP file is empty
Your ZIP file is empty. Can you post another file that works (or maybe copy th source into the message) Thanks, Nate |
|
#5
| ||||
| ||||
|
yeah, I'll post one later on tonight! probably has to do with the thread being moved from UNIX discussion to the Archive. |
|
#6
| ||||
| ||||
| File no longer available download the file (use the 'save link as...' thing, don't just click it, we don't want Stuffit Expander doing anything). now, in the terminal: Code: cd /Library/StartupItems cp ~/Desktop/dhcpd-startup.tar.gz . tar -xzvf dhcpd-startup.tar.gz rm dhcpd-startup.tar.gz enjoy Last edited by Cheryl; January 13th, 2009 at 05:05 PM. Reason: File no longer available |
|
#7
| ||||
| ||||
| update please
I have tried to install the latest version (3.0p1) on the latest OS X release (10.2.1) and all I get is error messages. When I enter ./configure I get the following list of error messages: Making links in common ln: raw.c: No such file or directory ln: parse.c: No such file or directory ln: nit.c: No such file or directory ln: icmp.c: No such file or directory ln: dispatch.c: No such file or directory ln: conflex.c: No such file or directory ln: upf.c: No such file or directory ln: bpf.c: No such file or directory ln: socket.c: No such file or directory ln: lpf.c: No such file or directory [... I have cut some lines that are similar to these...] ln: discover.c: No such file or directory ln: comapi.c: No such file or directory ln: dhcp-options.5: No such file or directory ln: dhcp-eval.5: No such file or directory make[2]: *** [links] Error 1 make[1]: *** [links] Error 1 make: *** [links] Error 2 Amd when, after that, I try to make I get the following: Making all in common make[2]: *** No rule to make target `raw.o', needed by `libdhcp.a'. Stop. make[1]: *** [all] Error 1 make: *** [all] Error 2 Can anyone help me with this and/or update the instructions for 10.2.1 and the latest release of DHCP? Dominik Schmid
__________________ My personal Apple history (italic = dead): * 1993: Centris 610, upg -> PM 6100/60, OC to 80MHz * 1998: iMac [233MHz, 384MB, 10GB] * 2000: PowerBook G3 [233MHz, 384MB, 20GB] * 2003: PowerBook G4 [15", 867MHz, 1GB, 100GB], 10GB 2G iPod * 2004: 20GB 3G iPod, Airport Express * 2006: MBP [15", 2GHz, 2GB, 160GB] * 2007 : MBP C2D [15", 2.33GHz, 3GB, 160GB] * Plus about 15 mostly 2nd hand Macs I bought for my friends and family. About the less Mac centric me. |
|
#8
| ||||
| ||||
|
Do you have the developer tools installed (the latest ones?). You'll need those.
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A bit of nostalgia: A Salute to Mac OS X | simX | Apple News, Rumors & Discussion | 31 | March 24th, 2005 06:45 AM |
| DNS server on Mac OS X workstation | nwelke | Networking & Compatibility | 1 | August 28th, 2003 11:11 PM |
| HP Photosmart 1315 and USB Print Sharing | zwheeloc | Mac Classic System & Software | 12 | February 6th, 2003 08:20 PM |
| apps list | Mac Osxtopus | Mac OS X System & Mac Software | 7 | May 29th, 2002 11:31 AM |
| Apple: Forget XP, try the Mac | tagliatelle | Bob's Place | 1 | November 25th, 2001 06:12 AM |