Community discussions

MikroTik App
 
planpc
just joined
Topic Author
Posts: 4
Joined: Sat May 15, 2021 1:41 am
Location: Spain

Accessing local server from WAN, shows incoming conection as Gateway LAN IP

Mon Apr 25, 2022 11:53 am

Hello, I will try to explain briefly.

Have a Synology NAS, with local ip: 192.168.1.100, there are some different web servers, each one of them in a different port, 3000, 40500, etc. The NAS has inbluid reverse proxy, and my NAT rules are configured, so I can access all well.

The problem is, when I access from LAN, to my public IP (or domain mynas.com) to access any of those web servers, the incoming IP in all of them is shown as the gateway local IP, 192.168.1.1

I have read many articles about Hairpin NAT and view every video on youtube, but cant view where is the problem.

Somebody can point my to the very firt point I have to do to avoid that?


Thanks
 
erlinden
Forum Guru
Forum Guru
Posts: 1920
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Accessing local server from WAN, shows incoming conection as Gateway LAN IP

Mon Apr 25, 2022 12:08 pm

Is this the same for external devices connecting through Internet?
Why not access through the local IP address (by use of your DNS server)?
 
planpc
just joined
Topic Author
Posts: 4
Joined: Sat May 15, 2021 1:41 am
Location: Spain

Re: Accessing local server from WAN, shows incoming conection as Gateway LAN IP

Mon Apr 25, 2022 12:18 pm

Hi erlinden,

when somebody connect from WAN, their WAN public IP is shown.

The problem is connecting from LAN to WAN at local servers.

I can also access all those servers by their local IP with no problem, but I would like to configure my router RB4011iGS+ correctly. Sometimes I will need to connect to those services the way an external user would.
 
erlinden
Forum Guru
Forum Guru
Posts: 1920
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Accessing local server from WAN, shows incoming conection as Gateway LAN IP

Mon Apr 25, 2022 12:20 pm

Have you seen this topic:
viewtopic.php?p=928918

Seems to be discussing your problem (if I understand correct).
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19103
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Accessing local server from WAN, shows incoming conection as Gateway LAN IP

Mon Apr 25, 2022 2:15 pm

viewtopic.php?t=179343

Without seeing your config, its hard to pinpoint a specific issue.

/export hide-sensitive file=anynameyouwish
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Accessing local server from WAN, shows incoming conection as Gateway LAN IP

Mon Apr 25, 2022 5:22 pm

There's no issue, that's what hairpin NAT does. Without it, if LAN client connects to public IP and its original souce address is kept, it doesn't work at all. Hairpin NAT fixes it, but small downside is that you can't see original source address. If you don't like that it's router's internal address, it can be something else, but still not the original. See second post in thread linked by @anav.
 
planpc
just joined
Topic Author
Posts: 4
Joined: Sat May 15, 2021 1:41 am
Location: Spain

Re: Accessing local server from WAN, shows incoming conection as Gateway LAN IP  [SOLVED]

Tue Nov 15, 2022 11:07 pm

Sorry for a very very late reply...

The problem was, and is, created by reverse proxy on a Synology NAS. When a page hosted in the NAS is visited from LAN by WAN URL, IP client showed is always the router LAN IP.

Who is online

Users browsing this forum: rjuho and 45 guests