Community discussions

MikroTik App
 
Matthai
just joined
Topic Author
Posts: 3
Joined: Mon May 23, 2016 11:23 pm

NAT reflection on Mikrotik?

Fri May 20, 2022 11:49 pm

I have a network with two virtual machines V1 and V2 (both in bridge mode). Router is Mikrotik and I have a public IP address (186.xx.xx.xx). Virtual machine V1 is Nginx proxy and V2 is my final destination (webserver my.server.si).

Now I am outside the network and I say "curl https://my.server.si". Web traffic goes to virtual machine V2 and I can see the normal web page.

So it goes like this:
186.xx.xx.xx:443 -> 10.0.2.3:443 (V1, Nginx proxy) -> 10.0.2.4:11000 (V2, my.server.si)

More detailed:
- request goes to public IP (186.xx.xx.xx)
- from there it is forwarded to virtual machine V1 (10.0.2.3, port 443), where is Nginx proxy
- then it is redirected to second virtual machine V1 (10.0.2.4, port 11000)

But then I say "curl https://my.server.si" on a second virtual machine V2 inside the network. (Actually, this server needs to call himself for some reason, don't ask me why). In that case, connection is not established.

I was reading and it seems I need NAT reflection. (NAT reflection refers to the ability to access external services from the internal network using the external (usually public) IP address, the same as if the client were on the Internet).

So my question is: how to do that on Mikrotik?
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: NAT reflection on Mikrotik?

Sat May 21, 2022 12:14 am

Also known as "hairpin NAT": viewtopic.php?t=179343

Who is online

Users browsing this forum: lurker888 and 22 guests