Score:-3

Can't connect to my localhost server with my public IP

cn flag

I have created a local node server on my laptop. And I can access it using the private IP (like 192.168.1.9:8080) on same network on my other devices like phone and other PC. I have disabled firewall.

But now I want to access it using my public IP. So that anyone using a different Internet connection can also connect to it. But it just doesn't respond.

I added a DMZ Host:

enter image description here

Then I added this port forwarding setting (I saw it on YouTube tutorial). I'm not very sure if it's correct or not.

enter image description here

And here is network status:

enter image description here

But it made no difference. Am I doing something wrong?

Note: My problem is probably not related to Hairpin NAT.

PS: If you think I've shared some sensitive/private information in the screenshots, please let me know I'll update it immediately.

in flag
The search term you are looking for is `hairpin nat`
Vikas avatar
cn flag
@GeraldSchneider Thanks I'll try them and will update soon.
Vikas avatar
cn flag
@GeraldSchneider I'm not sure if that is the thing I am looking for. Isn't Hairpin NAT is more about connecting to your server using public IP with same network? Note that I want to access my server from a different brand network in a different location. I think that wouldn't count hairpin NAT? That is how I understood it.
Vikas avatar
cn flag
"This question already has answers here:" No it doesn't.
Vikas avatar
cn flag
Note for future visitors: Hairpin NAT is a different issue. Nothing to do with issue described in my question detail.
user9517 avatar
cn flag
This is a home use question and has no place on [sf] it should have been asked on [su].
Score:2
es flag

first check if your ISP doesn't user GCNAT and provides you with a real IP address. then you need to configure a firewall and port forwarding your router. Don't do all port range from 1 to 65535, configure only ports you need.

yourrounter_IP:8080 => localserver_IP:8080

Vikas avatar
cn flag
Do I need to put same IP and ports in WAN and LAN in port forwarding? I don't know what WAN host IP and port are for.
4snok avatar
es flag
WAN IP is an IP your rounter gets from ISP via DHCP. "WAN and LAN" don't have to be the same, you can put any. if you put WAN port 80 and LAN port 8080 your router with forward all traffic from its public ip port 80 to your local server's private ip port 8080
Vikas avatar
cn flag
So if I put different ports (80 for WAN, 8080 for LAN), I should be able to access my server using *yourrouter_IP:80* ?
Vikas avatar
cn flag
https://i.stack.imgur.com/grnIo.jpg
Vikas avatar
cn flag
I think the problem is GCNAT. In this screenshot, you see 100.100.x.x IP which is different from public IP. Right?
4snok avatar
es flag
yep, CGNAT subnet is 100.64.0.0/10 - from 100.64.0.0 to 100.127.255.255. Usually ISPs provide a public IP address as an additional service
Vikas avatar
cn flag
Anyway. There is no free solution for this? Other than using some VPN?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.