wlan1添加ip地址
ip addr add 192.168.1.1/24 dev wlan1 broadcast 192.168.1.255
dnsmasq
配置文件
# wlan1
domain=mi6.dnsmasq.com
interface=wlan1
dhcp-host=192.168.1.1
dhcp-range=192.168.1.100,192.168.1.200,12h
dhcp-option=3,192.168.1.1
dhcp-option=option:dns-server,114.114.114.114,8.8.8.8
重启dnsmasq
$ service dnsmasq restart
* Restarting DNS forwarder and DHCP server dnsmasq [ OK ]
hostapd
配置
driver=nl80211
ssid=mi6-wifi
channel=10
interface=wlan1
wpa=2
wpa_passphrase=mi6-wifi-001
wpa_key_mgmt=WPA-PSK WPA-EAP
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
加载hostapd
hostapd /etc/hostapd/hostapd.conf -B
开启nat转发
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -o wlan0 -j MASQUERADE
标签:1.1,hostapd,dhcp,开启,192.168,wlan1,ubuntu,dnsmasq,热点
From: https://www.cnblogs.com/shiguoliang/p/16757333.html