Answer the question
In order to leave comments, you need to log in
Linux + PPP + Wi-Fi + NAT + Forwarding. How to set up and check?
I'm trying to set up internet via wi-fi on an android phone. What is available:
Linux with Internet via PPPoE and Wi-Fi mesh in AP mode. Android phone connected to Wi-Fi. Configured hostapd, dnsmasq to issue an IP address and iptables rules. The result almost turned out: the Internet is on the phone, but some of the applications do not work. I suspect that the problem is somewhere in iptables
# clear all previous rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
# set default ACCEPT
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# enable MASQUERADE
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# send all packets to android device
iptables -t nat -A PREROUTING -p tcp -i ppp0 -d 10.34.146.10 -j DNAT --to-destination 192.168.0.60
iptables -t nat -A PREROUTING -p udp -i ppp0 -d 10.34.146.10 -j DNAT --to-destination 192.168.0.60
Answer the question
In order to leave comments, you need to log in
А зачем при НАТ пробрасывать все порты? Уберите последние две строчки и проверьте еще раз.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question