peebles / rpi3-wifi-station-ap-stretch

Version that works for Stretch
113 stars 31 forks source link

Suggested iptables rule is not forwarding traffic #9

Open MacroYau opened 6 years ago

MacroYau commented 6 years ago

I have just followed the guide to configure on a Raspberry Pi 3 running Raspbian Stretch (the 2018-06-27 build). It all went smoothly except for bridging AP clients to the Internet using the suggested iptables rule:

iptables -t nat -A POSTROUTING -s 10.3.141.0/24 ! -d 10.3.141.0/24 -j MASQUERADE

Then I went back to the older version (pre-Stretch) tutorial and adopted these rules, everything is working perfectly now:

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