Hi. I have problem with my RB751u-2hnd and rb951g-2hnd.
I’m trying to configure hairpin nat on ROS v6.x according to http://wiki.mikrotik.com/wiki/Hairpin_NAT
Before upgrade to 6.x it was working perfectly, but now srcnat doesn’t see this packages so it doesn’t work.
Is there any another way to configure this? Or maybe it’s a bug?
Forwarding works well between client and server1 (no need to configure hairpin nat), but not between client and server2. Hairpin nat rule doesn’t see this packages - counter is 0:
so tell me how to add static DNS entry that redirects me from port 81 to port 80?
I want to put address http://<my_domain>:81 in my web browser and get connection to server2 on port 80 (10.1.1.196:80)
Another time I want to put address http://<my_domain>:80 and get connection to server1 on port 80 (10.1.1.197:80)
You said “This config works well on v5.x but not on v6.x.”
OK, let’s assume we use 5.x where it works.
Will it work, with serwer connected to the SWITCH? In this configuration everything is on one Mikrotik port. Is it possible to work?
Do you think that this little detail was quite irrelevant and barely worth mentioning in the first place? This little piece of information changes everything, right now I do not have any solution for you.
Same problem - rule working ok on v.5.25, not ok on 6.0 and obove
Example
/ip firewall nat
add chain=dstnat action=dst-nat to-addresses=local.ip.address to-ports=80 protocol=tcp dst-address=public.ip.address dst-port=80
Now on v.6.3
dstnat is ok on the public network, but not in local
The problem is not in DNS.
I have a public ip subnet lets say 8.8.8.1-8.8.8.20 these are assigned to a mikrotik. The mikrotik then has a private ip range of 192.168.1.xx. The publics are dstnat to the privates with the same ending number.
So. 8.8.8.1 is nated to 192.168.1.1 and so forth
we also have a srcnat for 192.168.1.1 to netmap to 8.8.8.1
from the server 192.168.1.1 that is netmap out 8.8.8.1 they can not access anything by using the public ip of a different server on the network like 8.8.8.8, however they can if they use 192.168.1.8 which is netpmaed to the 8.8.8.8 because its just local addresses.
These rules were working with 5.14 but are not working with 6.3 firmware.
I know 8.8.8.8 is a subnet held by google. I changed the subnet for privacy.
Then, I did a srcnat with src address 192.168.1.0/24 to dst address 192.168.1.0/24 and masquerade and it still does not seem to be working. I tried putting it at the top of the list and it still doesn’t work.
I have 6 Cloud Core Routers in offices around the world. In each office I have with ROS6.x (all versions so far) been able to successfully implement hair pin with the following:
I have that rule in the router and it is set at as rule 0, i have also tried setting it as the last src nat in the list and rebooted each time.
I turned on logging of traffic and I dont see the servers even hitting the router. I rolled back to 5.26 and everything started working again. Not sure what i did wrong.
Did you put the hairpin rule in before the router was live and programmed? It is my guess that it has to be done at the very begging before having the router live. I fixed the issue by going back to 5.25. So I dont know what is going on with it.