I'm running an unlocked and rooted Samsung Galaxy Note 20 Ultra 5G (SM-N986U1) with an Android 12 custom ROM on the most recent security patch. The goal is that any devices that connect to my mobile hotspot have access to machines on my home network. I mainly would like to do this in order to use the Air Link feature of Oculus remotely without forwarding a different port each time I connect - I tried side-loading WireGuard on my Quest Two, when I connect it just locks the whole OS up, so that's not an option.
The local IP range of devices connected via hotspot is 192.168.36.0/24. I guess the hotspot interface is called swlan
I tried
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.36.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.36.0/24 dev swlan0 scope link table 61
ip route add broadcast 255.255.255.255
But it returns
/vpnroute.sh <
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: No such device
When both tun0
and swlan0
are active - so I'm not sure what it means "no such device".
I do have root access but I am not at all familiar with routing traffic on Linux/Android or iptables
or anything of that nature so I am in need of help. If someone could hook me up with some commands I can just paste into an adb shell to accomplish this that would be much appreciated.