2022-06-29

Can use public ip adress to connect to webserver but only when connected to the same internet

Introduction

I have a simple node.js WebServer which just contains a simple express example. It hosts at my private ip adress 192.168.1.155 at port 80. I can use that adress to connect to the server and everything works fine.
Then I went to my router to add port forwarding and I can now use my public ip adress to connect to the server (too).

Problem

But the connection with the public ip adress only works when I am connected to the same internet. I tried to connect with the public ip with my iPhone with mobile data instead of the same wifi and it didn't work.

Solution?

Has anyone discovered the same problem and is there a solution to it?

Edit...

Thanks to @robertklep who mentioned about CGN or CGNAT (Carrier Grade Network Address Translation) I visited https://www.remoterig.com/wp/?page_id=3494 and I found out this: "CGN makes communication in the other direction, from outside Internet and in to LAN impossible"



No comments:

Post a Comment