[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dhcp



On Mon, 3 Nov 2003 18:15:12 +0800
Robert Storey <y2kbug@ms25.hinet.net> wrote:

RS> I've had my LAN working well for a long time using static IP
RS> addresses(specified in /etc/hosts).
RS> 
RS> Now I would like to play with dhcp, but I found the info in the

DHCP is neat.  Just that.  Until the day your server dies and you have to quickly get back to static IP's unless you have a backup.  But that only hurts with large networks.

RS> Debian reference manual  pretty minimal and I admit I don't really
RS> know what I'm doing. But this is what I've done so far:

If you don't know what you doing, you should be in /usr/share/doc/HOWTO already.  Or at least google ;-)


RS> On both machines (desktop and laptop) I installed Debian packages
RS> "dhcp" and "dhcp-client". I edited /etc/default/dhcp like this...
RS> 
RS>   INTERFACES="eth0"
RS> 
RS> ...and then rebooted. The boot-up messages indicate the server is
RS> starting. Remember that this is on both machines - perhaps that
RS> isn't correct and I should only run the server on one? Anyway, one

Yep, you have a server with static IP, and configure the other boxes to be clients.  There should be a graphic way to do this, btw (I have yet to get X on Debian, so I can't really tell!)

RS> machine has a hostname ibm.utopia.com and the other is
RS> sonic.utopic.com. From sonic, typing "ping ibm" produces the message
RS> "ping: unknown host ibm" (ditto for the fully qualified host name).
RS> Without the benefit of /etc/hosts I'm not sure how the server is
RS> going to know the names of the clients.

1.- DHCP can do dynamic DNS updating: when a DHCP client registers, it sends its hostname and domain.  The DHCP server can then send an update to a DNS server to add/modify such hostname to the new IP.  Of course, you need both a DHCP and DNS servers with proper config.

2.- "ping ibm": sonic would need to have a search entry for utopia.com in /etc/resolv.conf for this to work.  You want a resolv.conf like this:

nameserver 10.10.10.1	# If you have a static DNS, put it here
search utopic.com utopia.com	# All the domains you want auto-search
				# The more, the slower!

3.- To test your settings, first check if there is any contact at all between the subjects with: "ping IP-address".  You can check the actual IP with ifconfig (eth0: inet-adrr: x.x.x.x).  Then you can "ping hostname".  To see more info from the DNS: "dig hostname.domain".


RS> Any help would be appreciated. Even pointing me to a FAQ or other
RS> online source would be cool.

Yep, you really need to RSFM (read some fine manuals =).

Manual pages: will describe commands, some config files, and weirder stuff.  Use like:

man dhcpd
man resolv.conf

In /usr/share/doc/ (or /usr/doc/ in not POSIX systems) are the release docs of most programs installed, organized in directories by program and version number.  Many have FAQ's, examples and the so.  Very useful, so check them, like "emacs /usr/share/doc/dhcp-3.0pl1" (the dhcp server).

Also there are the HOWTO's (/usr/share/doc/HOWTO --if not there, get'em in tldp.org).  They are wonderful, step-by-step instructions with unique humor and historic comments of about anything you would ever want to do.  In Linux, at least.  They are the last resort when you can't get it done with the manuals and docs.  Or the first if you just want to get to it quick and dirty, or are new in the block.  So I recommend those for you ;-)

I recommend Net-HOWTO.  There is also the DNS-HOWTO, and mini/DHCP (a mini HOWTO), but I think none of those talks about dynamic DNS update (its a somewhat recent feature).  It is really easy to setup, though, so just check the manual and the examples.

Have phun!




Reply to: