[plug] dhcp networking

Ryan ryan at is.as.geeky.as
Thu Jul 31 17:03:30 WST 2003


> I have a debian box with dhcp installed. and i was wondering how to
> write a script for my debian client so when my server is turned off it
> will still have an ip so it can access the rest of my network.
> does anyone have any sujestions on how i might go about this?

laptop-net, switchconf, whereami etc. can all do that, but take some
reading to setup.

(on my lpatop) I just press CTRL-C during boot to stop dhclient looking
around and then run a script to put a static IP on the ethernet device. 
It isn't as pretty as the other packages, but it isn't all-together
different from what they do either :)

If you are not aware, the setting to make an eth device obtain a DHCP
address on bootup goes in /etc/network/interfaces and could look like
this:

auto eth0
iface eth0 inet dhcp

man /etc/network/interfaces when i read it ages ago seemed to suggest
you could program in all sorts of smarts to possibly do what you need in
that file without using anything external, I didn't follow up on this
obvious, anyone done it?

You could also play around with /etc/dhclient.conf (if you use
dhclient), I think that can do this sort of thing if you reduce the
retry and timeout settings and set other sane defaults if no dhcp lease
is obtained within an acceptable sitting and staring at screen period.

I'm open to suggestions just as you are on this.

Ryan



More information about the plug mailing list