版权声明:本文为博主原创文章,未经博主允许不得转载。 http://www.cnblogs.com/ahcc08/p/8496398.html
代码版本:dhcp-4.2.5-P1
cd dhcp-4.2.-P1;
./configure --host=arm-XXX-linux ac_cv_file__dev_random=yes;
cd ./bind;
tar -zxvf bind.tar.gz;
修改Makefile第55行:./configure改成./configure --host=arm-XXX-linux --with-randomdev=/dev/random
修改./bind-9.8.4-P2/lib/export/dns/Makefile.in 169行:
CC改成BUILD_CC
cd ..;make;make install;
运行:
1、给无线网卡设置ip地址和子网掩码
ifconfig wlan0 192.168.1.2 netmask 255.255.255.0
2、创建文件dhcpd.conf
vi dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.3 192.168.1.11;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.2;
option domain-name-servers home;
}
3、创建/var/db/dhcpd.leases
mkdir /var/db;
touch /var/db/dhcpd.leases
4、运行命令
./dhcpd -cf dhcpd.conf wlan0
5、如下图所示:手机已经连接成功,加密类型 WPA2 PSK 并获取ip地址
wep加密类型的: