[BusyBox] default config for ifup???

Steven Scholz steven.scholz at imc-berlin.de
Wed Feb 5 08:06:03 UTC 2003


Uwe Beutin schrieb:
> On Tue, 4 Feb 2003, Steven Scholz wrote:
> 
> 
>>How could I use a default config just in case the dhcp requests fail (e.g. cable 
>>is unplugged during boot up) ???
> 
> 
>>E.g use 10.0.9.153/255.255.0.0 if udhcpc fails...
> 
> 
> In case you have ifconfig/route in your system, use it. Check what kind
> of result or exit code dhcpd gives when it fails. Put the appropriate
> ifconfig startup script in your /etc/rc oder wherever you have it.

For now I hav esomething like
...
. /etc/sysconfig/network-scripts/ifcfg-eth0
if [ "${BOOTPROTO}" = bootp -o "${BOOTPROTO}" = dhcp ]; then
echo -n "Determining IP information for $DEVICE..."
     if /sbin/udhcpc -n -q -s /etc/dhcpc/default.script; then
        echo " done."
     else
        echo " failed! Using defaults settings (IPADDR=$IPADDR)..."
        /sbin/ifconfig eth0 $IPADDR  broadcast $BROADCAST netmask $NETMASK
     fi
...

in my /etc/rc.sh.

But I would actually prefer using ip tools and just have a

/sbin/ifup eth0

in the start script...

Steven







More information about the busybox mailing list