I am seeking advice on a networking issue I have run into recently. I suspect that I a making an obvious mistake in my assumptions about connections between machines on separate networks.
My goal is to connect to a raspberry pi tcp server that I built in c++, through a mobile cellular hotspot. The connection works perfectly fine when through a local network. However, when I attempt to connect from my home network to the pi server, nothing seems to work.
I have already:
- Verified the public IPv4 address that I am using to connect
- Disabled IP filtering, firewalls, and set up port forwarding on the mobile hotspot
- Tested connections with open source http servers, also with port forwarding, in the same situation, with no success
I am happy to post the server or client code, however I suspect that my mistake is somewhere in the assumptions I have made about connections between computers on separate networks.
Any advice on further tests to try or resources to consult would be appreciated.
EDIT: to clarify, the connection path is: my computer -> home wifi network -> mobile hotspot (with port forwarding enabled) -> my raspberry pi
port forwarding
from the public ip, which is probably your routers ip on WAN side to forward traffic to the Raspberry. However if the WAN side of the router does NOT have a public ip, then you have to connect through another server like for instanceDigital Ocean
s droplets. The VPN layout you will be using is calledhub and spoke
.