3

I have two related questions:

1- When I see my global IP address in a website like https://whatismyipaddress.com/, which is for example X.X.X.X, I think this is not only mine, and a lot of people who are connected to my ISP may see this IP as their global IP address too. Is this correct? Or this IP is uniquely for me and it only may change in future (for example in my next connection)?

2- Based on the first question (the global IP is not only for me), I want to run a web server on my PC and access it over the internet without a static IP through a server which has a static IP. I think I should be able to do something like that but I don't know how?

Here is what I'm thinking about: https://i.sstatic.net/rDovQ.jpg

1- My PC is connected to the server using a socket (something like VPN). PC_SOCKET is connected to SERVER_SOCKET.

2- A client asks a url and the server redirects it to my PC (PC_SOCKET) using SERVER_SOCKET (nginx proxy_pass)

3- PC_SOCKET gives the requested url to my web server (nginx) and gets the response

4- PC_SOCKET sends the response to SERVER_SOCKET

5- SERVER_SOCKET gives the response to nginx

6- The client receives the response

Sorry if I asked this simple question in a complicated way. The only thing that I need is how should I redirect requests between server and my PC.

3 Answers3

3

If your public IP address is shared for you with others, then the ISP is using Carrier-grade NAT. The best way to avoid it is to ask the ISP for a static IP address (this might be a paid option).

If your public IP address is not shared, you could use Dynamic DNS instead of using a static IP address for your site, coupled with Port forwarding from the router to the computer of the server's port. This will let others access your computer by name, rather than by an IP address that might change daily.

Some routers have support for some specific Dynamic DNS suppliers, and you could check which one is supported by your router, then check if a free account will suffice for your needs.

If your router does not support Dynamic DNS or you don't like the ones that it does support, you could use a Dynamic DNS provider such as Dynu. Its free account also provides a free program that runs as a system service on your computer and takes care of keeping your IP address updated on the Dynu DNS servers.

harrymc
  • 498,455
1

The IP you see on whatsmyipaddress is usually your IP, not a shared one for multiple clients. Then you can use a dynamic-DNS service like no-ip.com to setup a static name for your address.

Once done, you have to configure your router to redirect http/https requests to your home server.

darxmurf
  • 121
  • 3
1

Actually with gronostag comment I found what I was looking for and that is https://github.com/fatedier/frp. I solved my problem.