Community discussions

MikroTik App
 
IgorKa
just joined
Topic Author
Posts: 7
Joined: Thu Jul 20, 2017 12:21 am

Problem with access to server via domain name

Fri Dec 31, 2021 12:29 pm

Hi guys
I wondering what could be the reason that the server in my local network is unreachable via domain name.
I have a domain name like
server.example.com
When I try to connect from the Internet (LTE on the cell phone) then everything is working fine, but I have no access to this server from my local network
In
/ip firewall nat
I can observe that packets are coming, but in Web Browser, I have "time out"
chain=dstnat action=dst-nat to-addresses=LOCAL_SUBNET_IP to-ports=8443 protocol=tcp dst-address=PUBLIC_IP dst-port=443 log=no log-prefix=""
One more thing, I have the default router configuration.

Thanks in advance for your help!
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Problem with access to server via domain name

Fri Dec 31, 2021 1:39 pm

The thing you're looking for is called hairpin NAT and simplest fix is:
/ip firewall nat
add chain=srcnat src-address=LOCAL_SUBNET/MASK dst-address=LOCAL_SUBNET/MASK action=masquerade
Bit more about it: viewtopic.php?p=892135#p892135
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19325
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Problem with access to server via domain name

Fri Dec 31, 2021 3:46 pm

At least link to the beginning of the thread LOL.
viewtopic.php?p=892135#p885249

But correct does sound more hairpin than ISP connectivity.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Problem with access to server via domain name

Fri Dec 31, 2021 3:55 pm

@anav: Your post is mostly about dstnat (which is ok), but since OP already has the best dstnat rule, I just wanted to add a bit more specifically about the srcnat part.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19325
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Problem with access to server via domain name

Sat Jan 01, 2022 2:20 am

Sounds good just let me know if I should beef up any part of the first post..................

Who is online

Users browsing this forum: No registered users and 31 guests