TQ2440 DHCP 配置
移植 dhcp 到 arm
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