Page 1 of 1

dns-nat question

Posted: Wed Aug 31, 2016 1:09 pm
by marktomlinson
Hi Guys

I am pretty sure this is documented several times over, however I am unsure of the terminology I am looking for and my searches have left me without an answer.

Essentially, what I am trying to do is setup a dst-nat rule but where the request appears to come from the MikroTik its self and not the original client, this is because the MikroTik is currently not the default gateway for the service it is trying to access.

Mark

Re: dns-nat question

Posted: Wed Aug 31, 2016 6:39 pm
by Sob
You need another srcnat rule for that (in addition to your dstnat rule). Simply set it to match your forwarded packets and use action=masquerade.

Re: dns-nat question

Posted: Wed Aug 31, 2016 10:33 pm
by ZeroByte
Hi Guys

I am pretty sure this is documented several times over, however I am unsure of the terminology....
FYI - the term for this is "hairpin NAT"


Another solution would be to use the Mikrotik's DNS proxy feature - instead of dstnat to the other server, use action=redirect (which redirects the dst of the request to become the Mikrotik itself). The Mikrotik would then make a DNS query on behalf of the client (using whatever server(s) the router has configured in /IP > DNS) and then give the answer back to the client.
You'd need to make sure "allow remote request" is turned on in /IP DNS, and *BE SURE* that your input firewall filter blocks DNS requests from the Internet itself so that you don't get this router taken over by a dns-amp ddos attack.

Re: dns-nat question

Posted: Thu Sep 01, 2016 2:13 pm
by marktomlinson
Thank you for your replies gentlemen - often terminology is my biggest barrier with MikroTik...but I do love the kit!