Community discussions

MikroTik App
 
User avatar
MarHazK
newbie
Topic Author
Posts: 28
Joined: Wed Mar 29, 2017 8:31 pm

Virtual Host (Multiple Subdomains, 1 public ip) DSTNat to Specific IPs

Fri May 03, 2024 9:46 am

I don't know is it possible to dstnat/re-route the multiple virtual host (IP > DNS Settings > DNS Static) that actually has 1 public IP to multiple internal ips. Might Not load balancing (not similar to haproxy since HAProxy only for web services), but more to routing.

Example,
if User open web browser at sub1.domain.com, he will redirected to Server A's webserver.
if User open web browser at sub2.domain.com, he will redirected to Server B's webserver.
if User access the SSH at sub1.domain.com, he will redirected to Server A's SSH service.
if User access the FTP at sub2.domain.com, he will redirected to Server B's FTP service.
and so on.

Here's the diagram I plan to do but is not sure is it valid/possible or not. Or is there any way/method around?

Image
 
User avatar
genesispro
Member Candidate
Member Candidate
Posts: 289
Joined: Fri Mar 14, 2014 12:33 pm

Re: Virtual Host (Multiple Subdomains, 1 public ip) DSTNat to Specific IPs

Fri May 03, 2024 5:27 pm

it would be an awesome feature but unfortunately as far as I am aware it is not possible.
I also use HAProxy for such cases
 
optio
Long time Member
Long time Member
Posts: 696
Joined: Mon Dec 26, 2022 2:57 pm

Re: Virtual Host (Multiple Subdomains, 1 public ip) DSTNat to Specific IPs

Fri May 03, 2024 5:48 pm

ROS doesn't provide reverse proxy service, you will need to setup it manually on some server or in ROS container, there are many choices like HAProxy, Nginx, Apache, Caddy...
In ROS setup nat for HTTP/S ports to IP of reverse proxy and rest is in reverse proxy configuration depending which is used.

You cannot use HTTP reverse proxy for non HTTP protocols. So for SSH and FTP you will need to find another solution, maybe some SSH/FTP server which provides this functionality and setup nat to its IP for these service ports.
 
emunt6
Member Candidate
Member Candidate
Posts: 105
Joined: Fri Feb 02, 2018 7:00 pm

Re: Virtual Host (Multiple Subdomains, 1 public ip) DSTNat to Specific IPs

Sat May 04, 2024 2:33 am

Another option is buying Linux VM from VPS hosting ( each has its own public ipv4, virtual machine ) - you making SNAT/DNAT to your Router.
Solution for the "need more public ipv4".
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 692
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: Virtual Host (Multiple Subdomains, 1 public ip) DSTNat to Specific IPs

Sun May 05, 2024 10:55 pm

Zero Trust

Who is online

Users browsing this forum: No registered users and 5 guests