D1哪吒开发板使用 RTL8723DS 作为WIFI中继
-
1。驱动RTL8723DS之后, ifconfig -a 命令出现两个设备:
root@TinaLinux:/# ifconfig -a ... wlan0 Link encap:Ethernet HWaddr 00:E0:4C:A7:D1:3A inet addr:192.168.3.119 Bcast:192.168.3.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:179282 errors:0 dropped:206 overruns:0 frame:0 TX packets:87704 errors:0 dropped:1 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:195274967 (186.2 MiB) TX bytes:15296595 (14.5 MiB) wlan1 Link encap:Ethernet HWaddr 02:E0:4C:A7:D1:3A inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::e0:4cff:fea7:d13a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:93844 errors:0 dropped:0 overruns:0 frame:0 TX packets:157945 errors:0 dropped:1551 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:15869708 (15.1 MiB) TX bytes:189752370 (180.9 MiB)
我们现在用 wlan0 作为sta,用wlan1作为soft ap,两个组合起来,作为家里wifi路由器的中继。
2。wlan0 连接路由器:
wifi_connect_ap_test memory 13800138000
3。设置wlan1 地址:
ifconfig wlan1 192.168.10.1 netmask 255.255.255.0 up
4。给wlan1开启dhcp服务器:
mkdir /var/lib/misc/ -p touch /var/lib/misc/dnsmasq.leases dnsmasq -i wlan1 --dhcp-range=192.168.10.100,192.168.10.109,2h
5。设置转发:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
6。设置***/etc/hostapd.conf***:
interface=wlan1 driver=nl80211 #driver=madwifi ssid=memory channel=9 hw_mode=g macaddr_acl=0 ignore_broadcast_ssid=0 auth_algs=1 wpa=3 wpa_passphrase=123456 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
7。用 hostapd 开启热点:
hostapd /etc/hostapd.conf &
-
看下转发文件配置值:
cat /proc/sys/net/ipv4/ip_forward
如果不为1, 那么要设置一下:
echo 1 > /proc/sys/net/ipv4/ip_forward
-
螃蟹wifi 做AP就算了,稳定性很差。你要是苹果的手机可以试试。我这有测试代码。
https://blog.csdn.net/MengXP/article/details/122736176?spm=1001.2014.3001.5501 -
-
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号