pacman -S dnsmasq hostapd
ip link set dev wlan1 up
ip addr add 192.168.100.1/24 broadcast 192.168.100.255 dev wlan1
/etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=ArchlinuxARM_RPI
hw_mode=g
channel=7
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
/etc/dnsmasq.conf
interface=wlan1
listen-address=192.168.100.1,127.0.0.1
dhcp-range=192.168.100.50,192.168.100.150,12h
systemctl start hostapd
systemctl start dnsmasq
echo "1" >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -P FORWARD ACCEPT
iptables -F FORWARD
编辑成一个脚本,没按着systemctl写
#!/bin/sh
ip link set dev wlan1 up
ip addr add 192.168.100.1/24 broadcast 192.168.100.255 dev wlan1
echo "1" >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -P FORWARD ACCEPT
iptables -F FORWARD
systemctl start hostapd
systemctl start dnsmasq