文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>移植dhcp到arm

移植dhcp到arm

时间:2010-07-16  来源:garyybl

http://udhcp.busybox.net/

下载Download the latest version (includes client): udhcp-0.9.8.tar.gz (43k) 31 Oct, 2002

在KERNEL中需要将 Packet socket和IP: DHCP support编译进内核或编译成模块.

DHCP服务器端:(编译器2.95.3)
1. 修改Makefile: 添加:      CROSS_COMPILE=arm-linux-

2. #make , 把生成的dhcpd文件下载到板子上.

make LDFLAGS="-static"

使用/usr/local/arm/2.95.3/bin/arm-linux-strip处理一下,

3. #cp samples/udhcpd.conf    /etc/                #copy udhcp/samples下的文件到目标板子的 /etc目录

4. # vi /etc/udhcpd.conf: 修改如下:

3 # The start and end of the IP lease block
4
5 start       192.168.1.20    #default: 192.168.0.20   为 winXP的ip地址范围
6 end        192.168.1.25    #default: 192.168.0.254

9 # The interface that udhcpd will use
10
11 interface   wlan0       #default: eth 0#目标板子上的无线网卡wlan0

85 #Examles
86 opt dns 222.201.130.30 222.201.130.33   #dns服务器
87 option subnet 255.255.255.0
88 opt router 192.168.1.10                       #wlan的 ip地址,做为网关地址
89 #opt    wins    192.168.10.10              #注释掉
90 option dns 192.168.1.10 # appened to above DNS servers for a total of 3
91 option domain local
92 option lease   864000      # 10 days of seconds

5 # ./dhcpd //运行dhcpd服务器

6 .设置内网winXP主机的无线上网方式为自动获取ip地址

下面是dhcp客户端的,

在编译Busybox时把 Networking Utilities下udhcp Server/Client中的 udhcp Client (udhcpc)选上。
关键点要把examples/udhcp/simple.script 脚本文件做为default.script拷贝到/usr/share/udhcpc/default.script

运行udhcpc
~ # udhcpc                                                                     
udhcpc (v1.5.1) started                                                        
Sending discover...                                                            
Sending select for 59.64.134.99...                                             
Sending select for 59.64.134.99...                                             
Sending select for 59.64.134.99...                                             
Lease of 59.64.134.99 obtained, lease time 10800                               
deleting routers                                                               
route: SIOC[ADD|DEL]RT: No such process                                        
adding dns 211.68.71.4                                                         
adding dns 211.68.71.5                                                         
adding dns 202.106.196.115                                                     
adding dns 202.106.0.20

相关阅读 更多 +
排行榜 更多 +
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

飞行射击 下载
<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

<img preview="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" width="32" height="32" src="http://pic.pdowncc.com/uploadimg/ico/2025/0523/1747993424374100.png" alt="弓箭勇者最新版" />

飞行射击 下载