0

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

5
  • 1
    Why complicate things? Setup a standard VPN server like for instance WireGuard and use that connection to connect to your network. Commented Sep 23, 2022 at 4:04
  • Just to get things straight. Where exactly does the mobile hotspot come into play? Connecting to the pi, or is the pi connected to that hotspot and you want that to work? or...
    – LPChip
    Commented Sep 23, 2022 at 8:10
  • @LPChip great clarification, see my most recent update. I am hoping to find out information like what fergycool added below about the feasiblity of this setup overall, I understand that you are going to have to trust that I have configured the network accurately
    – ivanovich
    Commented Sep 23, 2022 at 18:41
  • @LasseMichaelMølgaard I will look into WireGuard! I was not aware of this possibility. To clarify, both the raspberry pi and the computer would connect to the VPN?
    – ivanovich
    Commented Sep 23, 2022 at 18:41
  • Yes the Raspberry pi acts as a server. You use 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 instance Digital Oceans droplets. The VPN layout you will be using is called hub and spoke. Commented Sep 24, 2022 at 8:22

1 Answer 1

0

If you are using a "consumer" SIM card then you do not know how long the IP address of your mobile hotspot will remain the same. For that matter it is likely that the cellular company will not allow any incoming traffic to reach the device. For such purposes you really need a M2M SIM card (and a M2M device for that matter). M2M (Machine to Machine) SIM cards are designed to keep a data connection between two devices constant and active. BUT they are far more expensive, even if the amount of data exchanged is low.

3
  • This is exactly the type of thing I was hoping to learn. Any advice on resources to seek to learn more about this kind of thing?
    – ivanovich
    Commented Sep 23, 2022 at 18:38
  • And to clarify, is this application possible with a standard SIM card, just not ideal, or will it be impossible to complete this project?
    – ivanovich
    Commented Sep 23, 2022 at 18:38
  • @ivanovich: Highly depends on the ISP/operator. The actual SIM card is not different, it's the plan/contract and the firewall rules that the ISP applies that make the difference – some ISPs require the card to be on a M2M/IoT or "fixed/home internet" plan, some will allow incoming connections if you pay $1/mo for a static IP address, some just allow that directly... Commented Sep 23, 2022 at 18:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .