I have been fighting through some NAT issues and I cant find where the problem is. I just set up My RB3011 a few days ago and finally got my primary webserver NAT/Hairpin configured and working. that webserver is on 192.168.1.10, the issue I am having now is with my Raspbery pi webserver. I follow the same steps but I see that if I try to access it from the wan side, it never touches my NAT/Maq rule. This may or may not be tied to my other issues. I tried to set a static IP on the router to give the Raspberry pi an address of 192.168.1.11, but it will not let go of 192.168.1.209. Does anyone know of issues with the raspberry pi conflicting with the Mikrotik Router? I gave up on changing the static IP, so it is now statically set as 192.168.1.209. My primary webserver(192.168.1.10) is set to port 80, and I am trying to set the raspberry pi(192.168.1.209) server to port 82. Any ideas?
EDIT: while doing some more troubleshooting I noticed that my home desktop isnt grabbing the static IP I set for it iether, so its not just the Raspberry pi. I dont know if these issues are related to the NAT not working, but apparently there is something not right with the DHCP server giving out the static Leases, I tried release/renew, and even restarted the computer and it still comes up with an address from the DHCP pool.
Thanks for the info, but that still didn’t work. I did find my issue with the Static IP addresses not working. I had to delete the Client IDs on some devices for them to grab the static address. I will switch some things around to see what i can find
Srcnat happens after dstnat, so if dstnat was from dst port 82 to 80, srcnat rule needs dst port 80. Well, generally speaking, in this case you can just skip ports completely and use one common hairpin NAT rule for all:
But he is hairpinning, so the source would be from his LAN, destination would be his WAN IP.
That is what the Wiki says:
To fix the issue, an additional NAT rule needs to be introduced on the router to enforce that all reply traffic flows through the router, despite the client and server being on the same subnet. The rule below is very specific to only apply to the traffic that the issue could occur with - if there are many servers the issue occurs with, the rule could be made broader to save having one such exception per forwarded service.
At first, source is some LAN address and destination is WAN address.
Then dstnat happens and new destination is server’s LAN address.
Then srnat (harpin) needs to happen and change the source. But if this srcnat rule uses dst-address or dst-port, it needs to be the new one.
And wiki is correct, it’s just that intead of two rules (one for each server), you can use common one that covers both.