Page 1 of 1

Question about NAT Virtual Address

Posted: Sat Dec 09, 2023 10:51 pm
by laurenettaieb91
Hi Forum,
I'm struggling to implement the following:
I have multiple web app on my NAS. Each of them is using a different port.
I'm trying to create virtual IP addresses outside of the dnspool and then redirect each IP address/port 80 to each app (i.e. sam IP address / unique port).
I have created both the IP address (outside of the pool) in the address list menu and attached it to an unused Ethernet port (not to the bridge) and then created a DNSNAT rule to redirect from virtual address/port 80 to NAS Address/true application port.
The log shows traffic when I'm using the browser to the virtual IP address but the browser doesn't provide any web page.
Any idea or have it done the wrong way ?
Thanks
Laurent

Re: Question about NAT Virtual Address

Posted: Sun Dec 10, 2023 11:31 am
by mkx
If your browsing PC is in same IP subnet as actual server (IP address on router, used as NAT intermediate, doesn't matter), then you have to implement hairpin NAT. Either use official docs or search this forum to get an idea of what and how.

Re: Question about NAT Virtual Address

Posted: Sun Dec 10, 2023 4:54 pm
by laurenettaieb91
Yes, it is indeed.
Thanks for pointing into the right direction.
Laurent

Re: Question about NAT Virtual Address

Posted: Tue Dec 12, 2023 12:05 am
by laurenettaieb91
In fact, I'm unsure this is truly what I'm looking for.
My sole objective is to have specific url pointing to the same IP address but with different ports.
I'm using Synology DNS server and obviously my mikrotik router is pointing to the Synology DNS server for LAN address resolution.
But there is no record type I can use to achieve my objective like:

application A , url: applA.personal_domain -> Internal IP, Port X
application B, url appl B.personal_domain -> Internal IP, Port Y

I have tried to have a specific virtual IP address for Application A and for Application B and then use DNS Hairpin to redirect to Internal IP, Port X and do the same for Application B.

Unsure, what would be the best method.

If someone has encountered the same issue or requirement.

Re: Question about NAT Virtual Address

Posted: Tue Dec 12, 2023 5:41 pm
by optio
My sole objective is to have specific url pointing to the same IP address but with different ports.
You need some reverse proxy for this, like Nginx. Create hairpin nat for reverse proxy http service and configure it redirect traffic by host name to specific webapp ip:port.

Re: Question about NAT Virtual Address

Posted: Thu Dec 14, 2023 12:26 am
by laurenettaieb91
Thanks Optio.
I'll check the documentation