D1-h启动softap_up失败
-
输出如下:
root@TinaLinux:/# softap_up 123 123123123 *************************** Start hostapd test! *************************** wpa2-psk! Start to set softap! Message is: OK Set softap finished! Start to start softap! SoftAP started successfullyHaving catch sig_chld! Message is: OK Start softap finished! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! iptables v1.4.21: Couldn't load target `MASQUERADE':No such file or directory Try `iptables -h' or 'iptables --help' for more information. Having catch sig_chld! enable data forward failed!
请各位大佬看看这是哪里出了问题呢?万分谢谢
-
@thorinkong 在 D1-h启动softap_up失败 中说:
Couldn't load target `MASQUERADE':No such file or directory
某些网络驱动没有勾选
-
@whycan 我是按照全志官方的文档配置的,但是文档中的很多选项在实际中没有,是不是和这个有关?
-
$ grep MASQUERADE -r ../longan/kernel/linux-4.9/ --include "Kconfig" ../longan/kernel/linux-4.9/net/ipv4/netfilter/Kconfig:config NF_NAT_MASQUERADE_IPV4 ../longan/kernel/linux-4.9/net/ipv4/netfilter/Kconfig: select NF_NAT_MASQUERADE_IPV4 ../longan/kernel/linux-4.9/net/ipv4/netfilter/Kconfig:config IP_NF_TARGET_MASQUERADE ../longan/kernel/linux-4.9/net/ipv4/netfilter/Kconfig: tristate "MASQUERADE target support" ../longan/kernel/linux-4.9/net/ipv4/netfilter/Kconfig: select NF_NAT_MASQUERADE_IPV4 ../longan/kernel/linux-4.9/net/ipv6/netfilter/Kconfig:config NF_NAT_MASQUERADE_IPV6 ../longan/kernel/linux-4.9/net/ipv6/netfilter/Kconfig: select NF_NAT_MASQUERADE_IPV6 ../longan/kernel/linux-4.9/net/ipv6/netfilter/Kconfig:config IP6_NF_TARGET_MASQUERADE ../longan/kernel/linux-4.9/net/ipv6/netfilter/Kconfig: tristate "MASQUERADE target support" ../longan/kernel/linux-4.9/net/ipv6/netfilter/Kconfig: select NF_NAT_MASQUERADE_IPV6 ../longan/kernel/linux-4.9/net/netfilter/Kconfig: on this machine or machines that will be MASQUERADED through this
看看勾选了没
-
-
-
-
@whycan
我也碰到了这个问题。我在kernel_menuconfig中有关MASQUERADE和iptables相关的选项全勾上了,也没有解决这个问题。还有哪些依赖项需要勾选吗? -
root@TinaLinux:/# softap_up test 13800138000 *************************** Start hostapd test! *************************** wpa2-psk! Start to set softap! Message is: OK Set softap finished! [STA_WRN] !!! xradio_remove_interface: vif_id=0 killall: wpa_supplicant: no process killed ieee80211_do_open: vif_type=3, p2p=0, ch=3, addr=dc:6a:fa:80:a7:a2 [STA] !!!xradio_vif_setup: id=0, type=3, p2p=0, addr=dc:6a:fa:80:a7:a2 [AP_WRN] ap restarting! [AP_WRN] [HT40][xradio_start_ap][PhyModeCfg:0xc007] [AP_WRN] vif0, AP/GO mode THROTTLE=58 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready Start to start softap! SoftAP started successfullyHaving catch sig_chld! Message is: OK Start softap finished! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! dnsmasq: failed to bind DHCP server socket: Address already in use Having catch sig_chld! Having catch sig_chld! iptables v1.4.21: Couldn't load target `MASQUERADE':No such file or directory Try `iptables -h' or 'iptables --help' for more information. Having catch sig_chld! enable data forward failed! root@TinaLinux:/# root@TinaLinux:/#
我的也炸了。
-
添加了一些调试代码:
root@TinaLinux:/# softap_up aaa 13800138000 *************************** Start hostapd test! ################################ *************************** wpa2-psk! Start to set softap! Message is: OK Set softap finished! [STA_WRN] !!! xradio_remove_interface: vif_id=0 killall: wpa_supplicant: no process killed ieee80211_do_open: vif_type=3, p2p=0, ch=3, addr=dc:6a:fa:80:a7:a2 [STA] !!!xradio_vif_setup: id=0, type=3, p2p=0, addr=dc:6a:fa:80:a7:a2 [AP_WRN] ap restarting! [AP_WRN] [HT40][xradio_start_ap][PhyModeCfg:0xc007] [AP_WRN] vif0, AP/GO mode THROTTLE=58 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready Start to start softap! SoftAP started successfullyHaving catch sig_chld! Message is: OK Start softap finished! Having catch sig_chld! Having catch sig_chld! aw_softap_enable_data_forward 332 : 11111111111111111111111111111111111111 aw_softap_enable_data_forward 336 : 11111111111111111111111111111111111111 Having catch sig_chld! aw_softap_enable_data_forward 341 : 11111111111111111111111111111111111111 execute command: iptables -A FORWARD -i wlan0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT Having catch sig_chld! execute command: iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT dnsmasq: failed to bind DHCP server socket: Address already in use Having catch sig_chld! execute command: iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT Having catch sig_chld! execute command: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables v1.4.21: Couldn't load target `MASQUERADE':No such file or directory Try `iptables -h' or 'iptables --help' for more information. Having catch sig_chld! enable data forward failed! root@TinaLinux:/#
发现是 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 命令行运行失败:
root@TinaLinux:/# root@TinaLinux:/# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables v1.4.21: Couldn't load target `MASQUERADE':No such file or directory Try `iptables -h' or 'iptables --help' for more information. root@TinaLinux:/#
-
我测试了一下,和驱动配置无关,用tina的rootfs和你们一样的错误,用buildroot编译出来的rootfs在这个D1s开发板运行正常了。
/etc/hostapd2.conf
interface=wlan0 driver=nl80211 #driver=madwifi ssid=whycan channel=9 hw_mode=g macaddr_acl=0 ignore_broadcast_ssid=0 auth_algs=1 wpa=3 wpa_passphrase=whycan.cn wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
/etc/udhcp.conf
start 192.168.0.100 #起始地址 end 192.168.0.199 #结束地址 interface wlan0 opt router 192.168.0.1 opt dns 192.168.0.1
执行命令:
killall wpa_supplicant
udhcpc -i eth0
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
ifconfig wlan0 192.168.0.1
hostapd -B /etc/hostapd2.conf
udhcpd /etc/udhcp.conf现在,手机可以连接这个开发板的WIFI热点上网了!
-
if [ -n "/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/linux-5.4.61" ]; t hen make -C /opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/linux-5.4.61 M= /opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addons-2.10/extensi ons modules; fi; make[7]: Entering directory '/opt/D1/tina_d1_open_v2_for_whycanpi/lichee/linux-5.4' CC [M] /opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addons-2. 10/extensions/ACCOUNT/xt_ACCOUNT.o In file included from /opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtabl es-addons-2.10/extensions/ACCOUNT/xt_ACCOUNT.c:35: /opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addons-2.10/extensi ons/ACCOUNT/../compat_xtables.h: In function 'par_net': /opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addons-2.10/extensi ons/ACCOUNT/../compat_xtables.h:86:12: error: 'const struct xt_action_param' has no member named 'net' return par->net; ^~ scripts/Makefile.build:286: recipe for target '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/tar get/linux-d1s-nezha/xtables-addons-2.10/extensions/ACCOUNT/xt_ACCOUNT.o' failed make[9]: *** [/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addon s-2.10/extensions/ACCOUNT/xt_ACCOUNT.o] Error 1 scripts/Makefile.build:556: recipe for target '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/tar get/linux-d1s-nezha/xtables-addons-2.10/extensions/ACCOUNT' failed make[8]: *** [/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addon s-2.10/extensions/ACCOUNT] Error 2 Makefile:1810: recipe for target '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s -nezha/xtables-addons-2.10/extensions' failed make[7]: *** [/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addon s-2.10/extensions] Error 2 make[7]: Leaving directory '/opt/D1/tina_d1_open_v2_for_whycanpi/lichee/linux-5.4' Makefile:456: recipe for target 'modules' failed make[6]: *** [modules] Error 2 make[6]: Leaving directory '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha /xtables-addons-2.10/extensions' Makefile:492: recipe for target 'all-recursive' failed make[5]: *** [all-recursive] Error 1 make[5]: Leaving directory '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha /xtables-addons-2.10' Makefile:377: recipe for target 'all' failed make[4]: *** [all] Error 2 make[4]: Leaving directory '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha /xtables-addons-2.10' Makefile:128: recipe for target '/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s- nezha/xtables-addons-2.10/.built' failed make[3]: *** [/opt/D1/tina_d1_open_v2_for_whycanpi/out/d1s-nezha/compile_dir/target/linux-d1s-nezha/xtables-addon s-2.10/.built] Error 2 make[3]: Leaving directory '/opt/D1/tina_d1_open_v2_for_whycanpi/package/network/utils/xtables-addons' package/Makefile:192: recipe for target 'package/network/utils/xtables-addons/compile' failed make[2]: *** [package/network/utils/xtables-addons/compile] Error 2
一顿骚操作勾选各种模块,编译失败,不折腾了,还是 buildroot 用着舒服。
-
@whycan
根据提示:No such file or directory,我进到iptables源码中去看了下,发现这句打印是在加载动态库的时候打印的,那这样的话就应该是在加载libiptMASQUERADE.so出错了。
我在D1s上查找该动态库,发现没有。然后到SDK下去找,发现在out编译目录下的iptables/extension目录中有该动态库。
为了验证我的想法,我就直接把这个动态库拷贝到目标板上,设置好动态库查找路径,然后再执行softap_up,发现提示成功了。但是无法查找到对应ap。使用ps查找进程,也没有hostapd进程,不知道为什么。
这样的话,有几个疑问:
1、iptables/extension下的动态库为什么不会拷贝到目标板上呢?
2、menuconfig中iptables下的一堆mod(上图)应该勾选哪些呢?
3、softap_up如果启动成功的话,会有hostapd进程的对吗? -
我也有类似的报错,但是热点确实正常启动了
root@TinaLinux:/tmp# softap_up test 12345678 *************************** Start hostapd test! *************************** wpa2-psk! Start to set softap! Message is: OK Set softap finished! [ 1484.692922] [STA_WRN] !!! xradio_remove_interface: vif_id=0 killall: wpa_supplicant: no process killed [ 1486.738620] ieee80211_do_open: vif_type=2, p2p=0, ch=3, addr=c8:25:bd:47:71:70 [ 1486.746979] [STA] !!!xradio_vif_setup: id=0, type=2, p2p=0, addr=c8:25:bd:47:71:70 [ 1486.763023] [AP_WRN] BSS_CHANGED_ASSOC but driver is unjoined. Start to start softap! SoftAP started successfullyHaving catch sig_chld! Message is: OK Start softap finished! Having catch sig_chld! [ 1487.843033] [STA_WRN] xradio_change_interface: new type=3(2), p2p=0(0) [ 1487.860622] [STA_WRN] !!! xradio_remove_interface: vif_id=0 [ 1487.871122] [STA] !!!xradio_vif_setup: id=0, type=3, p2p=0, addr=c8:25:bd:47:71:70 [ 1487.970774] [AP_WRN] ap restarting! [ 1487.991469] [AP_WRN] [HT40][xradio_start_ap][PhyModeCfg:0xc007] [ 1488.019303] [AP_WRN] vif0, AP/GO mode THROTTLE=58 [ 1488.050841] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! Having catch sig_chld! iptables v1.4.21: Couldn't load target `MASQUERADE':No such file or directory Try `iptables -h' or 'iptables --help' for more information. Having catch sig_chld! enable data forward failed!
问题是连上热点的设备无法联网(就算板子能正常联网)
-
@siguadao 请问下,您最后softap成功了吗,我也卡在这里了
-
@konosiba MASQUERADE是用来实现NAT的,没有这个确实是没法实现转发
-
@fanhuacloud 大佬ap配网可以使用吗
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号