You are not logged in.

#1 2017-01-17 05:18:38

dartNNN
Member
Registered: 2017-01-17
Posts: 1

PPP + Wi-Fi + NAT + Forwarding

I tried to configure internet access for my android device via Wi-Fi. My network configuration:

Linux box with internet via PPPoE and Wi-Fi in AP mode. Android device connected to this Wi-Fi. I configured hostapd to start Wi-Fi, dnsmasq to assign IP for my android and iptables rules.

# 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

Two last lines was added because some of android apps requires port forwarding over NAT, and I tried to configure forwarding for all ports. Not sure something of this done correctly.

With this configuration I have half result on android: skype & web browser works, all other apps - not.

What I miss? What is done incorrectly?

Offline

Board footer

Powered by FluxBB