一、得到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
