On Wed, 02 Nov 2005 20:50:29 +0100, Gernot Butschek wrote:
> Hi everybody,
> Can anybody give me a hint how to configure the DHCP client properly.
> This is my expected behaviour:
> I want to have the DHCP client check if there is a DHCP server available.
> If yes the IP address submitted by the DHCP server should be used.
> If no DHCP server is found in the network my computer should fall
> back to a fixed IP address rather than not assigning any IP address at all.
Hmmm, kind of a chicken or the egg problem. You cannot ping the dhcp
server until you get the lease and route connection.
My suggestion is to set the nic config for dhcp and let the system try
to bring it up. You script would run next and ping wherever you want
and if fails, swap out nic config file and try again.
> A config file snippet to put me on the right track is highly appreciated.
You can use
http://groups.google.com/advanced_group_search
network_ck in the first box and
bit twister in the Author box might find you a starter script.
Does not do exactly as you asked because different distributions have
nic config files in different places. Other people's Free advice:
http://www.catb.org/~esr/faqs/smart-questions.html
For extra points:
! bash script introduction documentation
http://tldp.org/LDP/intro-linux/html/index.html
! bash script advanced documentation
http://tldp.org/LDP/abs/html/index.html