Community discussions

MikroTik App
 
aputia
just joined
Topic Author
Posts: 1
Joined: Mon Nov 01, 2021 12:01 pm

I can access website from external but not from internal

Mon Nov 01, 2021 12:21 pm

Hi,
I have a RB760iGS board. I have default configuration:
- ethernet 1 is WAN
- ethernet 2, 3, 4, 5 is bridged on my lan

My LAN is 192.168.0.0/24
My website: http://MYDOMAIN.COM that is connected with my internal server 192.168.0.67

If I connect to http://MYDOMAIN.COM from WAN (eg my smartphone with mobile network) everything works.
If I connect to http://MYDOMAIN.COM from LAN, it is unreachable.

I created a srcnat rule, but it doesn't work
/ip firewall nat add action=masquerade chain=srcnat dst-address=192.168.0.67 dst-port=80 protocol=tcp src-address=192.168.0.0/24 comment=http from LAN
Now, because I have several services on my server 192.168.0.67 (80, 443, 21, etc etc) reachable using MYDOMAIN.COM, is there a way to enable all of them in order I can access from LAN using domain name?

Thanks
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11627
Joined: Thu Mar 03, 2016 10:23 pm

Re: I can access website from external but not from internal

Mon Nov 01, 2021 1:30 pm

Either have split DNS (so that it returns LAN IP addresses to LAN clients) or configure hairpin NAT.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19371
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: I can access website from external but not from internal

Mon Nov 01, 2021 3:02 pm

Sounds like hairpin nat scenario.
viewtopic.php?t=179343
 
User avatar
karlisi
Member
Member
Posts: 440
Joined: Mon May 31, 2004 8:09 am
Location: Latvia

Re: I can access website from external but not from internal

Mon Nov 01, 2021 3:27 pm

Modify nat rule to this (assuming your bridge is called LAN)
/ip firewall nat add action=masquerade chain=srcnat dst-address=192.168.0.67 src-address=192.168.0.0/24 out-interface=LAN comment="http from LAN"

Who is online

Users browsing this forum: No registered users and 94 guests