I want to forward my local port outside of network as does in routers but through phone's network. I having Android 11.
I have looked many pages and fortunately found this but this seems like it does forward my local server inside my local network, I'm newbie to networking.
adb shell "ip -4 addr"
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
3: rmnet0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN group default qlen 1000
inet 26.88.120.96/24 scope global rmnet0
valid_lft forever preferred_lft forever
11: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
inet 192.168.36.69/24 brd 192.168.36.255 scope global wlan0
valid_lft forever preferred_lft forever
26: rndis0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 192.168.23.126/24 brd 192.168.23.255 scope global rndis0
valid_lft forever preferred_lft forever
Any help/link regrading this would be grateful. Sorry if i asked wrong question.
socat
. It allows to accept TCP connections and then forward them to a configured IP address similar to a proxy (but does not require root). – Robert Feb 03 '22 at 09:13socat tcp-l:2222,fork,reuseaddr tcp:<ip>:80
– Adarsh Raj Feb 03 '22 at 10:49adb forward
? – Adarsh Raj Feb 03 '22 at 11:10adb reverse
may also work. But I am not sure if it binds the open port to the mobile interface. – Robert Feb 03 '22 at 11:58