Setting up "dhclient" to get a fallback configuration
Hello,
I'm trying to setup a fallback configuration for "eth0" device when no
DHCP server is available in the local network. But I can't :-)
By reading the manual ("man dhclient"), it seems to be possible to define
an optional setup for that precise purpose:
***
(...) A mobile host which may sometimes need to access a network on which
no DHCP server exists may be preloaded with a lease for a fixed address
on that network. When all attempts to contact a DHCP server have
failed, dhclient will try to validate the static lease, and if it
succeeds, will use that lease until it is restarted.
***
So I edited "/etc/dhclient/dhclient.conf" and added:
***
lease {
interface "eth0";
fixed-address 172.16.0.66;
option subnet-mask 255.255.255.0;
option routers 172.16.0.1;
option domain-name-servers 80.58.0.33;
}
***
After restarting the network service, eth0 is not configured (it
defaults to APIPA address 169.254.x.x) and "syslog" tells:
***
Oct 6 07:24:29 debian dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Oct 6 07:24:37 debian dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
Oct 6 07:24:53 debian dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
Oct 6 07:25:07 debian dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21
Oct 6 07:25:28 debian dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 2
Oct 6 07:25:30 debian dhclient: No DHCPOFFERS received.
Oct 6 07:25:30 debian dhclient: No working leases in persistent database - sleeping.
***
What I am missing here?
Also, I turned on debugging in "/etc/dhcp/dhclient-enter-hooks.d/debug"
to gather additional data but I can only see a "FAIL" message and none
of the variables defined in the lease section of "dhclient.conf" are
being applied at all.
Any clue about how to get this working?
P.S. I'm running an up-to-date Squeeze but I've also tested within Lenny
and got the same results.
Greetings,
--
Camaleón
Reply to: