[CoLoCo] Switching from DHCP to static ips

Kevin Fries kfries at cctus.com
Tue Dec 2 16:58:44 GMT 2008


Hey Ken,

How is your DHCP being administered?  Is it a real DHCP server or something like a Linksys router?

The reason I ask, is if it were a real DHCP server, it is usually a better idea to leave DHCP in place and force the fixed addresses in the server.  Its often referred to as "reserved" addresses.  In short, you go into your DHCP configuration file and define your host addresses (this would already have been done).  Then within that configuration block, you define a host, identify it by the Mac address of the NIC, and then assign the address there.  If you also run your own DNS of internal, go to the bind configuration files and set up the name there, then use the names in your DHCP configuration.  This way, you manage DNS in one location, and it become easy to maintain, yet if you have somebody come over and has a laptop (say an out of town relative staying with you for a few days), they can also just plug in, and use the internet without having to jump through static hoops, or you can add machines without having to update all your existing host files.

Here is a simple example, assume you have one machine that you want to run a web service.  You want it to respond under www, and your network address is 192.168.100.0/24, the actual name of the machine is called snoopy, and is at host 10.

In the zone file (DNS) for your domain, you would add the following lines:

snoopy   IN   A                192.168.100.10
www     IN   CNAME       snoopy

In the reverse zone file, you would add the following line:

10           IN   PTR       snoopy.example.com.

Now you have snoopy responding as www via DNS.  Now lets get DHCP serving that name to that machine.  Lets assume the network interface (there could be more than one, or only one depending on the machine) has a MAC address of 01:02:03:04:05:06

In your DHCP configuration file you will find a block that is labled subnet for your network.  Inside that block add the following sub-block:

   host snoopy {
      hardware ethernet 01:02:03:04:05:06;
      fixed-address snoopy.example.com;
   }

Now you www will always be at 192.168.100.10.  If you move it to another location, just adjust the appropriate lines, all the client machines will follow automatically.  Have a guest machine when your wife's PITA brother comes for a visit, no problem, the DHCP will allow his machine to work without annoying you.  Also, if you have snoopy also running FTP, you can simply add one more cname to the DNS forwarding zone and it will work.  If you have a second server called Charlie and you want to move the FTP from Snoopy to Charlie, simply change the forwarding zone file to update that cname, and every client will see it as soon as any local caches time out.  DNS and DHCP are two tools that I have always found easier to manage via vi than via the graphical tools.

Much cleaner setup, and easier to manage... Hope this helps.

Kevin Fries
Senior Linux Engineer
Computer and Communications Technology, Inc
A division of Japan Communications Inc
(303) 708-9228 x326



________________________________________
From: ubuntu-us-co-bounces at lists.ubuntu.com [ubuntu-us-co-bounces at lists.ubuntu.com] On Behalf Of Kenneth D Weinert [kenw at quarter-flash.com]
Sent: Tuesday, December 02, 2008 7:21 AM
To: Ubuntu Colorado Local Community Team
Subject: [CoLoCo] Switching from DHCP to static ips

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I decided that on my internal network I'd switch to static IPs since
there are some shared resources and it's much easier to keep a local
hosts file and navigate between the boxes with static IPs.

So, I made the changes according to this page:
http://www.cyberciti.biz/tips/howto-ubuntu-linux-convert-dhcp-network-configuration-to-static-ip-configuration.html
and I either missed something or there's been a change since this was
written.

It all seemed to work *except* after I rebooted. I now have DHCP
addresses on all the boxes again.

A bit frustrating, to say the least.

Any pointers on what I might have missed, a better tutorial for making
this change, etc - all ideas are welcome.

Thanks.

Oh, 8.04 is what I'm running locally.

Ken

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJNUROH0OpnUzq8fARAn0FAJ9xYkodvLOSHYT+v2RLvuDDus74mwCfYLZJ
XkBJ1DfENlLtzdXMDySEiFc=
=28Bb
-----END PGP SIGNATURE-----


--
Ubuntu-us-co mailing list
Ubuntu-us-co at lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-co



More information about the Ubuntu-us-co mailing list