Perform IP forwarding for devices within the same local network. (The real target is transparent proxy but the IP forwarding is a prerequisite)
All devices are in the same local network
- main router
- Android phone
192.168.2.10gateway set as
- others like Raspberry Pi at
- Data disabled, only WiFi connects.
- rooted Android 10 (Pixel 2 XL)
- enabled ip forwarding by
sysctl -w net.ipv4.ip_forward=1
- netfilter: on all tables of nat, mangle, filter and raw, run
iptables -F -t <table_name>and
iptables -X -t <table_name>
- rp_filter: Disable by
sysctl -w net.ipv4.conf.all.rp_filter=0and
sysctl -w net.ipv4.conf.wlan0.rp_filter=0
- the computer cannot access to the Internet,
dig, browser, nothing works.
- the computer connects to local devices without any problem (like ping router
192.168.1.1, SSH to the Raspberry Pi, or use FireFox through the SOCK5 proxy hosted on the Pi).
- Android phone connects to the Internet perfectly.
iptables -t <table_name> -L -vto show packet count, all chains have some packets, *except the
FORWARDchain of both
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes). After some googling, rp_filter is the suspect but I'm sure it's turned off.