Note:
Kernel version: 2.6.30.9
BusyBox version: 1.15.2
Working users for PC Linux and Development Board Linux: root
1. Configure the kernel:
[*] Networking Support--->
Networking Options--->
<*> Packet Socket
<*> Unix domain sockets
[*] TCP/IP Networking
[*] Ip:kernel level Autoconfiguration
[*] IP:DHCP Support
[*] Network packet filtering Framework (NetFilter)--->
2. Configure BusyBox:
Networking Utilities--->
[*] UDHCP client (UDHCPC)
3. Create the configuration file:
Copy the Simple.script file from BusyBox examples/udhcp/to the/usr/share/udhcpc/of the Development Board and rename it to Default.script
4. Test:
Perform UDHCPC on the command console, note that you must ensure that a DHCP server exists in the LAN or UDHCP execution fails.
The following results are performed on easy2440:
UDHCPC (v1.15.2) started
Setting IP address 0.0.0.0 on eth0
Sending Discover ...
Sending Select for 192.168.1.101 ...
Lease of 192.168.1.101 obtained, Lease time 7200
Setting IP address 192.168.1.101 on eth0
Deleting Routers
Route:SIOCDELRT:No such process
Adding Router 192.168.1.1
Recreating/etc/resolv.conf
Adding DNS Server 211.148.192.141
Adding DNS Server 210.21.196.6
5. Modify the System initialization configuration file to get the IP address automatically after the board is powered on:
Modify the/etc/init.d/rcs file to add a command in the appropriate location:/SBIN/UDHCPC &
6. Enjoy it!
Arm-linux configuring DHCP to obtain IP addresses automatically