1

I have a MikroTik router set up at the entrance of our office network. I'm looking to configure it for specific domain-based port forwarding. The task seems to be rather common, but I am stuck. Here's what I need to achieve:

  • Requests to office1.example.com:443 should be redirected to Server1 on port 443.
  • Similarly, requests to office2.example.com:443 should be redirected to Server2 on port 443. How can I set up these domain-specific port forwarding rules on the MikroTik router?

Any guidance or steps to follow would be greatly appreciated.

1 Answer 1

0

At first you have to create address list entries for your domains

/ip firewall address-list add address=Server1 address=office1.example.com list=office1
/ip firewall address-list add address=Server2 address=office2.example.com list=office2

And then create nat ruls via:

/ip firewall nat add chain=dstnat protocol=tcp dst-port=443 src-address-list=office1 action=dst-nat to-addresses=Server1 to-ports=443
/ip firewall nat add chain=dstnat protocol=tcp dst-port=443 src-address-list=office2 action=dst-nat to-addresses=Server2 to-ports=443

Please double check the syntax to prevent errors.

New contributor
AmirD12 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • The IP address of the domain is resolved when the rule is added. If the IP address changes, then the firewall rules need to be reapplied. 2 hours ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .