However, the documentation available from busybox is not very comprehensive. There is a man-page available which can be found by googling udhcpc - very small DHCP client.
The operation of udhcpc is simple and unix-y. When it receives a reply from a DHCP-server, it calls a script with one parameter, which is one of:
- deconfig: remove configuration (when lease is lost or udhcpc starts)
- bound: moving from unbound to bound state (receives configuration)
- renew: lease is renewed
- nak: nak received from server
- leasefail: (not documented in the man-page): run if there is no reply after configured timeouts and retries
I have basically used the sample scripts that came with BusyBox (examples/udhcpc/*), but converted them to using the ip(8)-command instead of ifconfig(8). I also added logging to syslog with the following function:
log() { logger -p daemon.info -t dhcp $* }
Ingen kommentarer:
Legg inn en kommentar