DHCP failover to static IP addr

From: Bob Williams (willi_at_willinet.com)
Date: 10/26/04


Date: Mon, 25 Oct 2004 15:53:16 -0700

I am configuring a Fedora Core2 Test2 system.
I would like to activate eth0 using dhcp, but if that fails (no dhcp server
on the network) I would like to assign a static IP address.

One approach is using dhclient and creating an /etc/dhclient.conf file:

send host-name "home.test";
send dhcp-client-identifier "home";
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name;
timeout 30;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;

lease {
interface "eth0";
option host-name "home.test";
fixed-address 10.1.1.1;
renew 1 2004/10/25 22:24:33;
rebind 2 2004/10/26 04:00:03;
expire 2 2004/10/26 05:30:03;
option subnet-mask 255.255.255.0;
option broadcast-address 10.1.1.255;
option domain-name "test";
}

This functions normally when a DHCP server is present on the net, but when
there is no server, 'ifup eth0' tries 10.1.1.1 but fails. It fails during a
verification process for 10.1.1.1 resulting in bash dumping its environment
variables and the contents of
/etc/sysconfig/network-scripts/network-functions. It then displays a usage
message for ping... eth0 remains down.

Does anyone know if this is a proper use for the fixed-address parameter of
a lease in the dhclient.conf file?

If this doesn't work, I guess I could just write a script that checks if the
interface is up after initial network startup. If not, it can configure the
interface with a static IP address.

Any suggestions?
Thanks in advance



Relevant Pages

  • Re: [opensuse] dhcp server forwarded with wifi
    ... Followed the howto on Novel on setting up a dhcp server for the internal ... network but while Im getting an IP the machines being served by the ... internal network can seem to find the net. ... you said that ath0 is connected to the ISP, and eth0 is connected to the ...
    (SuSE)
  • Re: Goodbye Redhat?
    ... > that isn't connected to a DHCP server? ... It then fails to do any network ... That's news to me, and should be filed as a bug. ...
    (comp.os.linux.misc)
  • Re: Manual DHCP server.
    ... hand out 2 different ranges of IP address. ... another DHCP server would take over if the first one fails. ... >> You can have multiple DHCP servers on the same network as long as they are ...
    (microsoft.public.windowsxp.general)
  • Re: Destination Host Unreachable
    ... The network is in a star configuration with a SonicWall router as the ... eth0: no IPv6 routers present ... # nVidia Corporation MCP55 Ethernet ...
    (comp.os.linux.networking)
  • Re: Samba nmbd messages in log (SOLVED)
    ... network is served off its own NIC (eth0). ... A separate NIC is connected thru cable modem to VOIP router. ... I can see my shares on the network from a Windows XP client. ... netbios name = SAMBA ...
    (Fedora)