how to run udcpc

Roberto A. Foglietta roberto.foglietta at gmail.com
Mon Dec 11 06:12:54 PST 2006


2006/12/11, satpal parmar <parmarsatpal at gmail.com>:
> Hi all;
>
> I am learning to use buzy box.So kindly bear with my naive questions. I am
> trying to run udcpc( uhcp clinet program with busybox) on am ARM 9 based
> board.
>
> For that I configured buzybox with clinet support.On porting I evoked clinet
> as :udcpc  -i -b eth0. I confirmed through ps that clinet if running.But it
> get hanged.

I will appreciate s/buzybox/busybox/g but probably I lack in sense of humor
;-)

I would have done:

udhcpc -b -i eth0 -s /etc/udhcpc-script

where /etc/udhcpc-script, for example:

# cat /etc/udhcpc-script
#!/bin/sh
echo "******************************** $1 ********* $interface $ip"
if test "$1" = "bound"; then
        echo $interface $ip netmask $subnet broadcast $broadcast
        ifconfig $interface $ip netmask $subnet broadcast $broadcast up
############### DNS ###############
        rm -f /etc/resolv.conf
        if test -n "$domain"; then
                echo "search $domain" > /etc/resolv.conf
        fi
        for i in $dns; do
                echo "nameserver $i" >> /etc/resolv.conf
        done
############### HOSTNAME ###############
        test -z "$hostname" && hostname=$ip
        hostname $hostname
        echo hostname: $hostname.$domain
        ifconfig $interface | egrep .
############### GATEWAY ###############
        test -n "$router" && route add default gw $router
        route -n; echo
fi


 I hope this help.

 Cheers,
-- 
/roberto


More information about the busybox mailing list