I have been to countless mikrotik forums and also watched youtube videos to implement hairpin NAT. But no luck with loopback.
I have a webserver running on 10.10.10.193:5050 which is accessible via LAN.
To access the webserver from WAN, I created a NAT rule in firewall to forward incoming traffic from my public static IP address (let's say 1.1.1.1:5050) to 10.10.10.193:5050.
Code: Select all
/ip firewall nat add action=dst-nat chain=dstnat comment="web server port" dst-address=\
1.1.1.1 dst-port=5050 log=yes log-prefix=\
"webserver-prod-" protocol=tcp to-addresses=10.10.10.193 to-ports=5050
But due to hairpin issue, I cannot access web server from my LAN IP using public IP
To address this, I created two new rules
Code: Select all
/ip firewall nat
add action=masquerade chain=srcnat comment="hairpin - same srcnat" \
dst-address=10.10.10.0/24 log=yes log-prefix="hairpin-masq" \
src-address=10.10.10.0/24
add action=masquerade chain=srcnat comment="hairpin nat" \
src-address=10.10.10.0/24 log=yes log-prefix="hairpin-masq" \
out-interface=pppoe-out1
Interface list. (see https://clb.sh/edeb0a)
Address list (https://clb.sh/016a1c)
*All blue entries are my public IP address.
any help would be greatly appreciated
Please let me know if you need any info or screenshots.