18 lines
880 B
Markdown
18 lines
880 B
Markdown
Hairpin NAT enables a device on the LAN to access another device on the LAN via the public IP
|
|
|
|
https://help.mikrotik.com/docs/display/ROS/NAT#NAT-HairpinNAT
|
|
|
|
From the RouterOS CLI, enter NAT configuration mode:
|
|
```
|
|
/ip firewall nat
|
|
```
|
|
|
|
Configure NAT to forward any traffic from the LAN net that's directed at the WAN IP to forward that traffic back to the the server in question (You can only forward to a single IP):
|
|
```
|
|
|
|
```
|
|
I first tried `add action=masquerade chain=srcnat dst-address=192.168.0.6 out-interface=LAN protoco ol=tcp src-address=192.168.0.0/24`, but was getting the error `input does not match any value of interface`.
|
|
|
|
Following the advice from <https://superuser.com/questions/1242353/routeros-hairpin-nat-produces-input-does-not-match-any-value-of-interface>, I changed `out-interface` to `out-interface-list`, and the command completed without any errors.
|
|
|