1

I have an Airtel router on which I wish to port forward my laptop's IPv4 which is 192.168.1.5.

enter image description here

The problem is the external IP I get is 122.168.65.76 and whenever I enter the external IP from my LAN I can access my server. But when I try it from a different network it does not work. The WEB server is running on port 80

3
  • 2
    It’s unclear what you haven’t been able to achieve with regards to setting up a port forwarding rule on port 80. You should edit your question to resolve that clarity issue
    – Ramhound
    Sep 7 at 11:14
  • It is a web server running on port 80 Sep 7 at 15:43
  • There might be several problems that would fit your symptoms, please check my answer on how to test them.
    – Albin
    Sep 8 at 3:56

2 Answers 2

2

Possible Problem 1: Some routers will not forward port 80 (when accessing from outside your LAN) but use it to access the router's setup over the internet. If you didn't activate this option (to access the router from the internet) you might get no connection at all. To test this you can try to set your web server to a different port and set up a new port forward to this port. Please don't use port 443 or 8443 either.

Possible Problem 2: You might be behind a carrier-grade NAT which will prevent you from accessing your web server over the internet (outside your LAN).

You can check this yourself by testing if your router's WAN IP matches your public IP. To do this you can use a website e.g. whatsmyip.com to find your public IP address. Your router's WAN IP will be shown within your router setup. If they don't match you are behind a carrier-grade NAT. If so, you might be able to access your server via IPv6, that is assuming you get one assigned by your ISP and your router supports it.

If IPv6 does not work and you still want a public IP, several workarounds exist. Easiest would be to ask your ISP to provide you with a public IP. Or you can use a VPN service or proxy that provides you with a public IP (or use a remote tool):

If you don't have a public IP address you will need to use a proxy or a VPN service (e.g. use AirVPN and setup a port forward). There is no way around that for "direct access" over the internet if you are on CGN. If you don't need "direct access" you could login into a local machine on your network via a remote tool (e.g. Anydesk) and access your Server from there.

see source for further details

3
  • Now I have change the port to 2000 but now the problem is that the connection status is DEACTIVE Sep 8 at 9:41
  • @Divyanshundley I'm not sure what you mean, please add the information to your question, a screenshot might be helpful. Port 2000 might be used by another application.
    – Albin
    Sep 8 at 10:05
  • Thank you for the good explanation! Dec 3 at 21:35
1

You should not port-forward the internal IP (192.168.1.5) to the external IP (122.168.65.76) of your router.
=> You should do it the other direction, as the request comes from.

Someone on the internet wants to connect your server:80 in your private LAN:

  1. He will ask http://122.168.65.76:80. (His system sends a TCP-SYN-request. That's the first contact package for the new connection to initiate.)
  2. The router has to forward this connections (incoming port :80) to 192.168.1.5:80
    (This you have to tell the router by port-forward configuration)
  3. The request reaches the server:80 and he will be able to reply as the router has stored the route of the incoming SYN request.

=> Set in your router to forward incoming port :80 to 192.168.1.5:80


If it is a good idea to expose a system in your (trusted) LAN to the internet is a different discussion.

1
  • There has been an update to the question, I don't think this is the problem
    – Albin
    Sep 8 at 3:57

You must log in to answer this question.

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