hostapd的配置如下: (1)首先sudo apt-get install hostapd (2)然后在etc/hostapd路径下添加hostapd.conf文件 (3)内容如下:interface=wlan0 driver=nl80211 ssid=YOUR_SSID channel=9 hw_mode=g ignore_broadcast_ssid=0 auth_algs=1 wpa=3 YOUR_PASS_PHRASE wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
注意修改interface 对应的接口 sudo apt-get install isc-dhcp-server 然后就配置编辑文件/etc/default/isc-dhcp-server文件 其中修改interface=“wlan1” /etc/dhcp/dhcpd.conf 然后 default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.2.255; option routers 192.168.2.254; option domain-name-servers 192.168.2.1, 192.168.2.2; subnet 192.168.2.0 netmask 255.255.255.0 { range 192.168.2.10 192.168.2.100; range 192.168.2.150 192.168.2.200; } 注释给出的例子 subnet 10.5.5.0 netmask 255.255.255.224 { range 10.5.5.26 10.5.5.30; option domain-name-servers ns1.internal.example.org; option domain-name "internal.example.org"; option routers 10.5.5.1; option broadcast-address 10.5.5.31; default-lease-time 600; max-lease-time 7200; } 启动是:sudo service isc-dhcp-server restart sudo service isc-dhcp-server start sudo service isc-dhcp-server stop hostapd启动是: sudo hostapd /etc/hostapd/hostapd.conf遇到问题以后hostapd error “nl80211: Could not configure driver mode”
可以用下面的命令行:sudo nmcli nm wifi off sudo rfkill unblock wlan sudo ifconfig wlan0 10.15.0.1/24 up sleep 1 sudo service isc-dhcp-server restart sudo service hostapd restart
Configuration
The error message the installation ends with might be a little confusing, but the following steps will help you configure the service:
Most commonly, what you want to do is assign an IP address randomly. This can be done with settings as follows:
nano -w /etc/dhcp/dhcpd.conf# Sample /etc/dhcpd.conf # (add your comments here) default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option routers 192.168.1.254; option domain-name-servers 192.168.1.1, 192.168.1.2; option domain-name "mydomain.example"; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; range 192.168.1.150 192.168.1.200; }
用hostapd配置wifi,isc-dhcp-server
最新推荐文章于 2024-10-10 07:40:28 发布