Configuring fallback IP address in dhclient.conf
Hi, I've an appliance (running Debian Etch) that needs to be able to run in an environment that might or might not have a dhcp server handy. I've made the following changes to dhclient.conf, and got surprising results: 1. The changes: timeout 10 ; lease { interface eth0; fixed-address 192.168.0.58; option subnet-mask 255.255.255.0; renew 2 2037/1/12 00:00:01; rebind 2 2037/1/12 00:00:01; expire 2 2037/1/12 00:00:01; } 2. The surprise: # /etc/init.d/networking stop; sleep 5; /etc/init.d/networking start Deconfiguring network interfaces...There is already a pid file /var/run/dhclient.eth0.pid with pid 3074 killed old client process, removed PID file Internet Systems Consortium DHCP Client V3.0.4 Copyright 2004-2006 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ Listening on LPF/eth0/00:90:fb:15:e0:00 Sending on LPF/eth0/00:90:fb:15:e0:00 Sending on Socket/fallback DHCPRELEASE on eth0 to 192.168.0.111 port 67 done. Configuring network interfaces...Internet Systems Consortium DHCP Client V3.0.4 Copyright 2004-2006 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ Listening on LPF/eth0/00:90:fb:15:e0:00 Sending on LPF/eth0/00:90:fb:15:e0:00 Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 No DHCPOFFERS received. Trying recorded lease 192.168.0.58 Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline] [-p pattern] [-s packetsize] [-t ttl] [-I interface or address] [-M mtu discovery hint] [-S sndbuf] [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination No working leases in persistent database - sleeping. done. - Does anyone have any idea what I'm doing wrong? Where's the 'ping' command coming from??? Any other suggestions on how to do this? Note that when a dhcp server is available, all works fine. Thanks, Rony To unsubscribe, send mail to [EMAIL PROTECTED] with the word unsubscribe in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
Re: Configuring fallback IP address in dhclient.conf
ronys wrote: Listening on LPF/eth0/00:90:fb:15:e0:00 Sending on LPF/eth0/00:90:fb:15:e0:00 Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 No DHCPOFFERS received. Trying recorded lease 192.168.0.58 Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline] [-p pattern] [-s packetsize] [-t ttl] [-I interface or address] [-M mtu discovery hint] [-S sndbuf] [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination No working leases in persistent database - sleeping. done. - Does anyone have any idea what I'm doing wrong? Where's the 'ping' command coming from??? Any other suggestions on how to do this? Since having two stations use the same IP address is a very hard situation to debug, as packets will randomly find their way to either of the stations, dhclient does a very sensible thing and before using a stored address in the case no DHCP server answers, it makes an attempt to ping the address it is going to use in an effort to try and detect if someone is already using it. In your case this backfires as it seems the 'ping' command format it is trying to use is somehow not compatible with your 'ping' command. Hope this helps, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker Codefidence Ltd. The code is free, your time isn't.(TM) Web:http://codefidence.com Email: [EMAIL PROTECTED] Office: +972-8-9316883 ext. 201 Fax:+972-8-9316885 Mobile: +972-52-8260388 Q: How many NSA agents does it take to replace a lightbulb? A: dSva7DrYiY24yeTItKyyogFXD5gRuoRqPNQ9v6WCLLywZPINlu!
RE: Configuring fallback IP address in dhclient.conf [solved]
Thanks, Gilad. While not quite the problem, it was enough to point me in the right direction. For those interested: The ping was called in /sbin/dhclient-script, called by dhclient as part of the handling of the dhcp response. The exact invokation is if ping -q -c 1 $first_router; then Obviously, $first_router wasn't set, resulting in the usage error I saw. Fix? Added option routers aaa.bb.ccc.ddd to the dhclient.conf lease {} stanza, so it's now: lease { interface eth0; fixed-address 192.168.0.58; option subnet-mask 255.255.255.0; option routers 192.168.0.58; renew 2 2037/1/12 00:00:01; rebind 2 2037/1/12 00:00:01; expire 2 2037/1/12 00:00:01; } Cheers, Rony _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gilad Ben-Yossef Sent: Monday, August 04, 2008 2:39 PM To: [EMAIL PROTECTED] Cc: linux-il@cs.huji.ac.il Subject: Re: Configuring fallback IP address in dhclient.conf ronys wrote: Listening on LPF/eth0/00:90:fb:15:e0:00 Sending on LPF/eth0/00:90:fb:15:e0:00 Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 No DHCPOFFERS received. Trying recorded lease 192.168.0.58 Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline] [-p pattern] [-s packetsize] [-t ttl] [-I interface or address] [-M mtu discovery hint] [-S sndbuf] [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination No working leases in persistent database - sleeping. done. - Does anyone have any idea what I'm doing wrong? Where's the 'ping' command coming from??? Any other suggestions on how to do this? Since having two stations use the same IP address is a very hard situation to debug, as packets will randomly find their way to either of the stations, dhclient does a very sensible thing and before using a stored address in the case no DHCP server answers, it makes an attempt to ping the address it is going to use in an effort to try and detect if someone is already using it. In your case this backfires as it seems the 'ping' command format it is trying to use is somehow not compatible with your 'ping' command. Hope this helps, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker Codefidence Ltd. The code is free, your time isn't.(TM) Web:http://codefidence.com Email: [EMAIL PROTECTED] Office: +972-8-9316883 ext. 201 Fax:+972-8-9316885 Mobile: +972-52-8260388 Q: How many NSA agents does it take to replace a lightbulb? A: dSva7DrYiY24yeTItKyyogFXD5gRuoRqPNQ9v6WCLLywZPINlu!