Slashdot Mirror


Set up a DHCP server to manage IP addresses

An anonymous reader writes "The second in a three-part series on how to leverage Linux to get the most from your network, this tutorial shows how to set up a Dynamic Host Configuration Protocol (DHCP) server with Internet Systems Consortium (ISC) DHCP. Sample code and configuration files are provided throughout to aid understanding."

13 of 30 comments (clear)

  1. Comp User/pass Link by Anonymous Coward · · Score: 4, Informative

    http://www.bugmenot.com/view.php?url=www.ibm.com

  2. Recommended: dnsmasq by Tux2000 · · Score: 5, Informative

    For small networks, I recommend using dnsmasq. It's a combined DHCP server and DNS server/proxy intended for use on a masquerading gateway that can run nearly without any configuration. Add your mac addresses to /etc/ethers for fixed IP adresses, add your hostnames to /etc/hosts, finito. There is no need to fiddle with to big servers (bind and ISC dhcpd). I use it on my (heavily modified) WRT54G with about 10 to 20 systems without any problems.

    Tux2000

    --
    Denken hilft.
    1. Re:Recommended: dnsmasq by JRIsidore · · Score: 2, Informative

      It's indeed a very helpful tool but it can cause some troubles. I tried it a while ago and got errors with Exim 4, it didn't like the DNS responses that dnsmasq sent out for my local machines and thus started to reject mails. Host queries and pings worked fine though. As I switched back to Bind the problems were gone. Dunno what went wrong, I didn't bother to dig deeper into this.

      --
      :w!q
    2. Re:Recommended: dnsmasq by Tux2000 · · Score: 2, Insightful

      I don't know what's wrong with dnsmasq+exim (and I'm too lazy to search google), but dnsmasq is under very active development and has fixed a lot of bugs, some esotheric, some really nasty. Details are in the changelog. Perhaps the trouble with exim has already been solved. You may want to give dnsmasq a second chance. ;-)

      I still use sendmail from Slackware 8 in my LAN, it just works, with both my now disabled bind and with dnsmasq 2.something. I want to change to some other mailer, but I've not yet found the time to learn and install exim or postfix.

      Tux2000

      --
      Denken hilft.
  3. Re:So what's the point? by Rikus · · Score: 2

    I don't think that DHCP is especially useful on a small network where each computer can be manually set up (simplifying things a bit), but it's even stranger to see a story like this on Slashdot. People who need to know how to set up DHCP servers should go to google.
    And while they're at it, they can google for all the other computer-related subjects that don't need to become news stories.

  4. Re:So what's the point? by shufler · · Score: 5, Interesting

    Actually, DHCP is especially useful on a small network, as you can setup the DHCP server to assign addresses to specific MAC addresses instead of manually configuring the details in the OS.

    This is handy if you continually resinstall operating systems on a box, and have gotten used to accessing it via a specific IP address, or whatever.

    Besides, by using DHCP, you can add new hosts without doing a thing. This means your friends can come over and plug their shit in without problems, and your network will be filled with with trojans in no time.

  5. WTF? by itwerx · · Score: 3, Funny

    Is Slashdot posting Howto's now?
    Or did an editor slip up (never!) and hit the "post this" button instead of the "delete" button?

    I hate being this confused on a Monday morning... :|

  6. Re:So what's the point? by squiggleslash · · Score: 3, Insightful
    Depends on whether (a) you use an off-the-shelf router (I used a couple and got fed up with stupid NAT connection auto-timeouts and the lack of auto fix-the-MTU hacks for PPPoE connections), and (b) whether it does all you want.

    On my network at home, my DHCP server sets itself up according to my DNS. So if I want to change a few IP addresses, or change my entire network to run in a different netblock, or whatever, it's a simple matter of modifying the two name server zones (something I'd have to do anyway), and restarting everything.

    I, admittedly, have a relatively large network for a home user (not that it's that big by /. standards), but it's not large by general standards.

    Different people will appreciate different tools for the jobs. Some people like those dedicated router things, but most of them have never left a secure shell session to the office open for fifteen minutes...

    --
    You are not alone. This is not normal. None of this is normal.
  7. Can't be bothered to register and RTFA by TheLink · · Score: 4, Interesting

    Anyway my suggestion is if you want better control, what you do is to have your DHCP server assign unknown machines to IP addresses in a quarantine network that possibly runs something like nocatauth to tell new users to contact the admin - phone num etc. Heck maybe put each of them in their own /30 network or something.

    Once they call you and you've identified the previously unknown machine and the user and everything is OK (scan for viruses, detect worms etc), you can reassign this machine to its own reserved IP - and possibly reconfigure the relevant switch's port to take it out of the special mode that only allows it to talk to one server and not each other (not all switches support this feature).

    This could help prevent unknown machines from spreading worms, or automatically getting access to your network.

    --
  8. How about a resource about setting up IPv6 network by MrSnivvel · · Score: 4, Interesting

    This is nice and all, but how about a comprehensive resource for setting up an internal network running IPv6. When adoption of IPv6 is always on the "Coming soon..." list (in North America at least), it would be nice to see an article, HOWTO, or something dealing the current setup and pitfalls.

    Knowing that the tools (RADVD or DHCPv6, 6to4 gateways, DNS "AAAA" records, etc.) are out there is one thing, knowing how to get them to fit together and pull it off is another. If anybody knows how to setup an internal IPv6-only network where systems are accessible from "the outside", info would be appreciated.

  9. Re:So what's the point? by TeknoHog · · Score: 2, Insightful
    Actually, DHCP is especially useful on a small network, as you can setup the DHCP server to assign addresses to specific MAC addresses instead of manually configuring the details in the OS.

    At the school where I work, we do exactly this. The idea is that workstations can be exact copies of a master image, but of course each must have a unique IP address. It's a lot nicer to set these up at the server, than going through the boxes separately. Especially when some of them are Windows machines.

    --
    Escher was the first MC and Giger invented the HR department.
  10. dhcp and linux by XO · · Score: 2, Insightful

    is there a functioning Linux distribution that DOESN'T come with a fully functioning DHCP server preinstalled, that you have to kill if you have more than one box on your network?? I don't think so..

    at least, after installing three Fedora boxes and a Debian box on my network, I had a hell of a time getting my networking to work on the systems, until I realised that without asking me, all of them installed a function DHCP client and server..

    (Linux distribution install programs suck)

    --
    "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  11. Dynamic DNS by Ann+Elk · · Score: 2, Insightful

    Some tips on getting dhcpd and bind to "play nicely together" would be useful. It's not rocket science, but it's not exactly obvious, either.