Community discussions

MikroTik App
 
EileK
just joined
Topic Author
Posts: 10
Joined: Sun Jun 27, 2021 7:24 pm

Accessing internal webserver from domain

Sun Jun 27, 2021 7:35 pm

Hi. I've just started using a MikroTik router for the first time in my life, and I've setup my network on the 192.168.200.0/24 block. I've found that when I port forward my webserver on the same block, I cannot access it from my internal network. I've found other forum posts with the same or similar issue here, but they all point to this empty wiki article on something called a Hairpin Nat. https://wiki.mikrotik.com/wiki/Hairpin_NAT
I was wondering how I would go about setting up my network to allow me to connect to my domain (which points to my public IP) to access a webserver on the same network. Any help would be appreciated. Here is the output of /ip firewall nat print

 > /ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic 
 0    chain=srcnat action=masquerade out-interface=ether1 

 1 X  ;;; https,http
      chain=dstnat action=dst-nat to-addresses=192.168.200.104 protocol=tcp 
      dst-address-type=local dst-port=443,80 dst-limit=1,5,dst-address/1m40s 
      log=no log-prefix=""
 
EileK
just joined
Topic Author
Posts: 10
Joined: Sun Jun 27, 2021 7:24 pm

Re: Accessing internal webserver from domain

Tue Nov 23, 2021 7:30 pm

Fixed:
/ip firewall nat add action=masquerade chain=srcnat dst-address=192.168.200.0/24 src-address=192.168.200.0/24
 
Zacharias
Forum Guru
Forum Guru
Posts: 3459
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Accessing internal webserver from domain

Tue Nov 23, 2021 8:44 pm

Fixed:
/ip firewall nat add action=masquerade chain=srcnat dst-address=192.168.200.0/24 src-address=192.168.200.0/24
Well with that rule you create the Hairpin Nat... ( in addition with the dst-nat rule that i guess you already have )

Take a look here https://help.mikrotik.com/docs/display/ ... airpinNAT

Who is online

Users browsing this forum: GoogleOther [Bot], outtahere, sas2k and 64 guests