Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Page 1 of 3 123 LastLast
Results 1 to 8 of 22
  1. #1
    kilowatt's Avatar
    kilowatt is offline mach-o mach-o man
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
    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:
    Code:
    sudo make install
    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.
    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;              
    }
    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

    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.
    Last edited by kilowatt; March 1st, 2002 at 01:40 PM.

  2. #2
    kilowatt's Avatar
    kilowatt is offline mach-o mach-o man
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    see ifconfig -a for a list of interfaces.

    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. #3
    kilowatt's Avatar
    kilowatt is offline mach-o mach-o man
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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)
    ok now download my file
    and move it and unstuff:
    Code:
    sudo mv ~/Downloads/dhcpd-startup.zip .
    sudo unzip dhcpd-startup.zip
    sudo rm dhcpd-startup.zip
    thats it!

    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
    Attached Files Attached Files

  4. #4
    natethelen is offline Registered User
    Join Date
    Feb 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #5
    kilowatt's Avatar
    kilowatt is offline mach-o mach-o man
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yeah, I'll post one later on tonight!

    probably has to do with the thread being moved from UNIX discussion to the Archive.

  6. #6
    kilowatt's Avatar
    kilowatt is offline mach-o mach-o man
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    thats it!

    enjoy
    Last edited by Cheryl; January 13th, 2009 at 05:05 PM. Reason: File no longer available

  7. #7
    doemel's Avatar
    doemel is offline Mac addict since 1993
    Join Date
    Feb 2002
    Location
    Zurich, Switzerland
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #8
    kilowatt's Avatar
    kilowatt is offline mach-o mach-o man
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you have the developer tools installed (the latest ones?). You'll need those.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. A bit of nostalgia: A Salute to Mac OS X
    By simX in forum Apple News, Rumors & Discussion
    Replies: 31
    Last Post: March 24th, 2005, 06:45 AM
  2. DNS server on Mac OS X workstation
    By nwelke in forum Networking & Compatibility
    Replies: 1
    Last Post: August 28th, 2003, 11:11 PM
  3. HP Photosmart 1315 and USB Print Sharing
    By zwheeloc in forum Mac Classic System & Software
    Replies: 12
    Last Post: February 6th, 2003, 08:20 PM
  4. apps list
    By Mac Osxtopus in forum Mac OS X System & Mac Software
    Replies: 7
    Last Post: May 29th, 2002, 11:31 AM
  5. Apple: Forget XP, try the Mac
    By tagliatelle in forum Bob's Place
    Replies: 1
    Last Post: November 25th, 2001, 06:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •