一、得到udhcpd(udhcp服务端):
1.解压busybox
2.配置busybox
Networking Utilities——>
[*] udhcp server(udhcpd)
[*] udhcp Client (udhcpc)
3.编译busybox
make defconfig
make
make install
4.拷贝 _install/usr/sbin/udhcpd 到板子/usr/sbin/下
拷贝examples/udhcp/udhcpd.conf 到板子/etc/下
二、内核裁剪支持
1.解压kernel源码包
2.配置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) --->
3.编译kernel
三、启动配置
1.开机创建/var/lib/misc/文件夹
2.创建/var/lib/misc/udhcpd.leases文件
3.给板子指定ip
4.修改udhcpd.conf文件,内容改为和板子指定ip同一网段,子网掩码相同
5.启动dhcp服务 udhcpd /etc/udhcpd.conf
四、局域网内其他终端设备开启dhcp服务(客户端),即可自动获取ip