I am having problems with my RouterOS. I have 6 WAN lines. I have run load balancing mode. Everything works very stable. It’s just that I’m trying to NAT some things that don’t work as expected.
The first is about Hairpin NAT.
I tried nat according to the instructions on the wiki. But somehow it doesn’t work in internal LAN. This is my NAT configuration:
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.10 dst-port=5060 out-interface=LAN protocol=udp src-address=172.16.0.0/22 to-ports=5060
add action=dst-nat chain=dstnat dst-address=ip-of-wan3 dst-port=5060 protocol=udp to-addresses=172.16.0.10 to-ports=5060
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.35 dst-port=443 out-interface=LAN protocol=tcp src-address=172.16.0.0/22 to-ports=443
add action=dst-nat chain=dstnat dst-address=ip-of-wan2 dst-port=443 protocol=tcp to-addresses=172.16.0.35 to-ports=443
The second is about NAT out on a fixed WAN IP line. Sometimes it works, sometimes it doesn’t work. This is my NAT configuration:
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.5 dst-port=4370 out-interface=LAN protocol=tcp src-address=172.16.0.0/22 to-ports=4370
add action=dst-nat chain=dstnat comment="CHAM CONG T1" dst-address=ip-of-wan4 dst-port=4370 protocol=tcp to-addresses=172.16.0.5 to-ports=4370
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.6 dst-port=4371 out-interface=LAN protocol=tcp src-address=172.16.0.0/22 to-ports=4371
add action=dst-nat chain=dstnat comment="CHAM CONG T2" dst-address=ip-of-wan4 dst-port=4371 protocol=tcp to-addresses=172.16.0.6 to-ports=4371
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.7 dst-port=4372 out-interface=LAN protocol=tcp src-address=172.16.0.0/22 to-ports=4372
add action=dst-nat chain=dstnat comment="CHAM CONG T3" dst-address=ip-of-wan4 dst-port=4372 protocol=tcp to-addresses=172.16.0.7 to-ports=4372
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.8 dst-port=4373 out-interface=LAN protocol=tcp src-address=172.16.0.0/22 to-ports=4373
add action=dst-nat chain=dstnat comment="CHAM CONG T4" dst-address=ip-of-wan4 dst-port=4373 protocol=tcp to-addresses=172.16.0.8 to-ports=4373
add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=172.16.0.35 dst-port=443 out-interface=LAN protocol=tcp src-address=172.16.0.0/22 to-ports=443
In this case, “CHAM CONG T1” and “CHAM CONG T4” are already active. But the remaining 2 ip does not work.