Fallback hard coded IP address when DHCP server not found.?

Fallback hard coded IP address when DHCP server not found.?

Post by Roberto Waltma » Wed, 05 Jun 2002 08:04:21



I am working on an embedded product based on
RedHat Linux 7.2

The system does not have any user accessible input
device.  Our customers configure it by hooking it
up to a network, and uploading script and data files
using FTP.  (  Telnet, rlogin, ssh, etc. are disabled.)

The customer's networks, over which we have
absolutely no control,  can be anything between a full
blown TCP network with DHCP and DNS servers to
just a cross-conect cable between our system and a
laptop, via a small intranet with or without DHCP
services.

The system may also be disconnected from the
network after the customization files are uploaded.
( It may then be reconnected to a different network,
in which case old DHCP cached data may cause
problems)

The problem I am trying to solve is to set up a single
boot configuration that would work on all this scenarios.

This is what I need, in pseudo-C-odish:

   if (link detected in ethernet port)
   {
         attempt to obtain a DHCP lease;  
         if (DHCP server found)
         {
               enable eth0 using IP
                   address from DHCP server;
         }
        else   /* no DHCP */
        {
              delete any cached data from
                  previous DHCP lease;
              enable eth0 using hard-coded IP
                  address, netmask, etc.;
        }
   }
   else   /* no link */
   {
         delete any cached data from
             previous DHCP lease;
         disable eth0;
   }

Rebooting the system to switch scenarios is not
acceptable, due to the time delay it will add until
the point were the main application starts to run.

Any pointers will be appreciated.
And yes, I am looking into man pages,  the various
rc.x hierarchies, etc.
Unfortunately I must solve this problem soon and,
as a novice Linux administrator, I find the amount of
information I need to absorb overwhelming, to say
the least.

Thanks,

Roberto Waltman

 
 
 

Fallback hard coded IP address when DHCP server not found.?

Post by Rene Tschaggela » Sat, 08 Jun 2002 20:55:27


Hardcoded IP : such as 192.168.1.99 ?

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net


> I am working on an embedded product based on
> RedHat Linux 7.2

> The system does not have any user accessible input
> device.  Our customers configure it by hooking it
> up to a network, and uploading script and data files
> using FTP.  (  Telnet, rlogin, ssh, etc. are disabled.)

> The customer's networks, over which we have
> absolutely no control,  can be anything between a full
> blown TCP network with DHCP and DNS servers to
> just a cross-conect cable between our system and a
> laptop, via a small intranet with or without DHCP
> services.

> The system may also be disconnected from the
> network after the customization files are uploaded.
> ( It may then be reconnected to a different network,
> in which case old DHCP cached data may cause
> problems)

> The problem I am trying to solve is to set up a single
> boot configuration that would work on all this scenarios.

> This is what I need, in pseudo-C-odish:

>    if (link detected in ethernet port)
>    {
>          attempt to obtain a DHCP lease;  
>          if (DHCP server found)
>          {
>                enable eth0 using IP
>                    address from DHCP server;
>          }
>         else   /* no DHCP */
>         {
>               delete any cached data from
>                   previous DHCP lease;
>               enable eth0 using hard-coded IP
>                   address, netmask, etc.;
>         }
>    }
>    else   /* no link */
>    {
>          delete any cached data from
>              previous DHCP lease;
>          disable eth0;
>    }

> Rebooting the system to switch scenarios is not
> acceptable, due to the time delay it will add until
> the point were the main application starts to run.

> Any pointers will be appreciated.
> And yes, I am looking into man pages,  the various
> rc.x hierarchies, etc.
> Unfortunately I must solve this problem soon and,
> as a novice Linux administrator, I find the amount of
> information I need to absorb overwhelming, to say
> the least.


 
 
 

1. How to find DHCP server IP Address ??

Hi all,

Just trying to setup ipfilter and I believe I need to add an allow rule for
the dhcp server to get through on.  now my problem arises that the ISP Tech
support say that they dont know what it is and probably wouldnt give it out
if they did.  So my question is :- Is there any way to find out what the
address is so I can enter it into my firewall rules.  Alternatively is there
another way to setup the firewall rules, I would prefer to set them up with
the DHCP server addy in there though.

TIA.

Matt.

2. User other than root able to start/stop Apache?

3. How do I find out my real IP address behind DHCP server?

4. Connecting newtwork to my PC thur. Linux

5. 3com 905b gets Ip address by using DHCP from NT DHCP server

6. nfsroot on Dell Inspiron 7500 w/ 3Com FE575C

7. DHCP fallback to fixed IP

8. rcp [basename: too many arguments]

9. DHCP woth Static IP Fallback

10. Unable to find IP address / host name lookup failure with DHCP (dhclient)

11. How to find ip address on a linux machine with Dhcp

12. dhcp server and static ip address...

13. Help: Mandriva 2005: Ethernet card won't get IP address from DHCP server