Hairpin not working with PPPoe (static WAN)

Hi,
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.

/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

After above rule, I was able to hit the webserver from WAN → 1.1.1.1:5050 from outside the network.
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

/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

The above two rules are at the top in NAT rules list. (see https://clb.sh/dfdbcf)

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.

How much time normally it takes to approve the post?

This link should provide some inspiration. Post back if still having issues.
https://forum.mikrotik.com/viewtopic.php?t=179343

Also when you post back with isssues unresolved ensure you post the entire config.
/export hide-sensitive file-anynameyouwish

Hi anav,

Thank you for your answer. I have been following your posts lately and did try the solution. At first, it didn’t work. Perhaps, due to other settings that I had in router. But after resetting configuration and adding the same rules again (with correct order) it’s working now.

Once again, thank you for the response. :slight_smile: