I have a VNC server running in localhost:1 of my Android phone. I want to access the VNC server from my computer, which is connected to the phone via usb tethering.
This is the output of ip route list (I have changed some ip addresses to number1, number2 and number3).
$ ip route list
default via number1 dev enp0s29f7u8 proto dhcp metric 100
number2 dev enp0s29f7u8 proto kernel scope link src number3 metric 100
I installed TigerVNC Viewer, and tried connecting to number1:1, number2:1 and number3:1, but all of them showed the error
unable to connect to socket: connection refused (111)
without the actual IP addresses and netmasks it’s tough to debug ip connectivity issues. If these are public IP addresses, change them to private ones like 10. or 192.168. instead of Number1, 2,3
This is the output, after connecting the computer to phone via USB tethering. The phone is connected to the internet via a 4G cellular network. There are no other network device/routers.
$ ip route list
default via 192.168.42.129 dev enp0s29f7u7 proto dhcp metric 100
192.168.42.0/24 dev enp0s29f7u7 proto kernel scope link src 192.168.42.96 metric 100
Do I need to provide the output of any other command?
You need to find the IP of the Phone which is acting as your router when you are tethered to it.
192.168.42.129
is likely it
It’s external IP may also work - but … going out and back in would be weird when the short way is there. ip neigh
could supply you with the needed information
as could arp-scan (if you have that installed)
$ ip neigh
192.168.42.129 dev enp0s29f7u7 lladdr 92:f3:e4:e2:a7:0d REACHABLE
fe80::b0e3:7fff:fe03:364e dev enp0s29f7u7 lladdr 92:f3:e4:e2:a7:0d router STALE
fe80::7441:bf32:7e50:4c5c dev enp0s29f7u7 lladdr 92:f3:e4:e2:a7:0d router REACHABLE