hostapd 客户端无法 ping 网关

hostapd 客户端无法 ping 网关

我有一台带 Intel 8260 无线模块的笔记本电脑。我运行以下命令将其设为无线路由器。现在测试客户端可以连接到我的 SSID,并获取 DHCP 地址,这两项都已从 hostapd/dnsmasq 日志中验证。但它无法连接到任何地方,也无法 ping 网关 (10.10.100.1)。请帮忙。我应该检查哪里?

iw dev wlp2s0 interface add wlan0_sta type managed addr 12:34:56:78:9a:bc
iw dev wlp2s0 interface add wlan0_ap type managed addr 34:56:78:9a:bc:de
ip link set wlp2s0 down

ip link set wlan0_sta up
wpa_supplicant -B -i wlan0_sta -c Magicloud.conf
dhclient wlan0_sta

hostapd -B hostapd.conf
ip a add 10.10.100.1 dev wlan0_ap
dnsmasq -C dnsmasq.conf

sysctl -w net.ipv4.ip_forward=1
echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o wlan0_sta -j MASQUERADE
iptables -A FORWARD -i wlan0_sta -o wlan0_ap -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0_ap -o wlan0_sta -j ACCEPT

dnsmasq配置文件

bind-interfaces
dhcp-range=10.10.100.10,10.10.100.100,255.255.255.0,12h
interface=wlan0_ap
no-resolv
server=8.8.8.8

hostapd.conf

auth_algs=1
channel=11
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
driver=nl80211
hw_mode=g
interface=wlan0_ap
own_ip_addr=127.0.0.1
ssid=myssid
utf8_ssid=1
wpa=2
wpa_passphrase=mypassword

相关内容