摘要
本文概要記錄在樹莓派4代單板電腦設定Wi-Fi extender的注意事項。
本文
這裡簡明扼要地介紹了設定樹莓派成為Wi-Fi extender的步驟;隨後將按照這些步驟來設定樹莓派4代單板電腦,其中,這裡的樹莓派4代所內建的1組Wi-Fi介面(映對至wlan0)將用來執行wpa_supplicant、而外接的一支USB Wi-Fi adapter介面(映對至wlan1)則用來執行hostapd。
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli -i wlan0 reconfigure
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install dnsmasq
sudo apt-get install hostapd
sudo nano /etc/dhcpcd.conf
sudo service dhcpcd restart
sudo nano /etc/hostapd/hostapd.conf
sudo nano /etc/default/hostapd
sudo nano/etc/init.d/hostapd
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo nano /etc/dnsmasq.conf
sudo nano /etc/sysctl.conf
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -t filter -A FORWARD -i wlan0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -t filter -A FORWARD -i wlan1 -o wlan0 -j ACCEPT
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo nano /etc/rc.local
sudo systemctl unmask hostapd
sudo service hostapd start
sudo service dnsmasq start
reboot
搭配Android平板電腦作為station進行trace route的測試結果如下。
|
Android 10之Wi-Fi介面狀態
|
|
Android 10之trace route執行結果 |
完成。
參考文獻
https://pimylifeup.com/raspberry-pi-wifi-extender/
https://www.section.io/engineering-education/setting-up-a-wifi-extender-using-a-raspberry-pi/
https://raspberrypi.stackexchange.com/questions/91074/how-to-configure-hostapd-for-a-5ghz-network
https://home.gamer.com.tw/artwork.php?sn=5449058
https://github.com/raspberrypi/documentation/issues/1018
https://forums.raspberrypi.com/viewtopic.php?t=198274
沒有留言:
張貼留言