idev1 / rpihotspot

Raspberry Pi - Hotspot (Access Point and WiFi Client/Station)
MIT License
156 stars 45 forks source link

fix for raspbian lite bullseye on pi zero w, uap0 not existing #40

Open fix-me opened 1 year ago

fix-me commented 1 year ago

First thx for the cool script! I had some troubles that the uap0 interface didn't exist to bring it up, so I got mine fixed like this:

Add udev rule

/etc/udev/rules.d/90-wireless.rules

ACTION=="add", SUBSYSTEM=="ieee80211", KERNEL=="phy0", \
    RUN+="/sbin/iw phy %k interface add uap0 type __ap"

Add iptables rule for post routing, fix for your ip range

echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.3.141.0/24 ! -d 10.3.141.0/24 -j MASQUERADE
iptables-save > /etc/iptables/rules.v4
Fantomita commented 1 year ago

I was having the same problem for the last couple of hours.. didn't even think about that. Thx!