Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-25-2004, 05:31 PM   #1
LQ Newbie
Registered: Oct 2004
Posts: 1

Rep: Reputation: 0
DHCP failover to static IP addr

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";
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;
option broadcast-address;
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 but fails. It fails during a verification process for 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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtain IP addr. from MAC addr? Ryand833 Linux - Wireless Networking 3 06-30-2005 01:59 PM
Redboot gets wrong default server IP-addr from DHCP ? waynix Linux - Networking 4 06-10-2005 12:44 AM
How to set up DHCP failover on Linux 3.0 shahirsha Linux - Networking 2 01-31-2005 12:29 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
[DHCP] Failover state fabrice Linux - Networking 0 04-30-2002 07:30 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration