Chinaunix首页 | 论坛 | 博客
  • 博客访问: 100536
  • 博文数量: 19
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-20 09:35
文章分类
文章存档

2010年(3)

2009年(16)

我的朋友

分类: LINUX

2009-05-20 21:46:05

下载Download the latest version (includes client): (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

阅读(4710) | 评论(1) | 转发(2) |
给主人留下些什么吧!~~

chinaunix网友2009-05-22 14:17:21

好服月租型IT服务台登录中国,诚邀阁下莅临体验! 月租型ITSM软件,注册即可使用! 详情请登录官方网站:http://www.servicezon.com