[1.16.2] Using udhcpc?
Gilles
codecomplete at free.fr
Wed Jun 22 09:17:39 UTC 2011
On Wed, 22 Jun 2011 04:27:10 +0200, Denys Vlasenko
<vda.linux at googlemail.com> wrote:
>There are two examples in http://git.busybox.net/busybox/tree/examples/udhcp:
>simple.script, or sample.script+sample.*
>
>Use either of them as a basis for your own scripts.
>
>Another example is in http://git.busybox.net/busybox/tree/examples/var_service
>(read the README, then check dhcp_if subdirectory)
Thanks. The following worked to get an IP configuration:
===============
#First, clear eth0
root:/var/tmp> ifconfig eth0 down
#Next, get IP configuration
root:/var/tmp> chmod +x simple.script
root:/var/tmp> udhcpc -i eth0 -p /var/run/udhcpc.pid -s
/var/tmp/simple.script
root:/var/tmp> ifconfig
===============
I didn't find a tutorial on udhcpc, so have a few questions, though:
1. If simple.script works, what are the other scripts (sample.*) used
for?
2. What are var_service files?
3. Am I correct in understanding that udhcpd.conf is for the DHCP
server, not the client?
4. If udhcpc only calls scripts, what's the point of udhcpc?
5. What is the right way to release IP configuration and kill udhcpc?
I tried this, but eth0 still has an IP configuration:
root:/var/tmp> udhcpc deconfig -s /var/tmp/simple.script
root:/var/tmp> ifconfig
6. "ps aux | grep dhcp" shows that the process is still running: Why?
Should I kill it with "killall" or launch it with "-q" ("Quit after
obtaining lease")?
Thank you for any help.
More information about the busybox
mailing list