I'd like to achieve a pretty basic configuration which can be easily setup on almost any kind of home router.
I have an external IP given by my ISP.
I'd like to forward certain ports to ports of local machines.
For example, I'd like all traffic coming to <external_ip>:80 to be forwarded to 192.168.0.1:80 (would be nice to set this up for requests coming from both external and internal requests)
Another example, <external_ip>:8990 -> 192.168.0.20:5900
And so on.
My ISP cable is connected to port 1 (ether1).
The internal IP address of the router is set to 192.168.0.2.
The external IP address of the router is set to <external_ip>.
I reset my config to default and tried applying rules from https://wiki.mikrotik.com/wiki/Hairpin_NAT, however, it didn't work.
Here are the specific commands I executed:
None of the solutions I found on the forum or in the Internet seemed to work.
Code: Select all
/ip firewall nat add chain=dstnat dst-address=<external_ip> protocol=tcp dst-port=80 action=dst-nat to-address=192.168.0.1 add chain=srcnat out-interface=ether1 action=masquerade add chain=srcnat src-address=192.168.0.0/24 dst-address=192.168.0.1 protocol=tcp dst-port=80 out-interface=ether2 action=masquerade
The best result I could achieve was: when entering <external_ip> from the outside of LAN, I was forwarded to MikroTik management interface, but that's totally different from what I was looking for.
The configuration of such a simple standard feature appears to be surprisingly complex with MikroTik
Any help is highly appreciated!