[SOLUTION] Traccar in NAT environment behind MikroTik

deep5 years ago

I just post a cli output of NAT rules of Traccar GPS Server behind MikroTik router!
Work with almost all GPS trackers based on the supported devices and their ports range!
Change ISP-WAN-IP and TRACCAR_LAN_IP to match your environment!
You can tune for your needs!

/ip firewall nat
add action=masquerade chain=srcnat comment=masquerade out-interface=ISP-WAN-IP
add action=dst-nat chain=dstnat comment="Traccar WebUI" dst-address=\
    ISP-WAN-IP dst-port=80 protocol=tcp to-addresses=TRACCAR_LAN_IP \
    to-ports=8082
add action=dst-nat chain=dstnat comment="Traccar AppComm" dst-address=\
    ISP-WAN-IP dst-port=5055 protocol=tcp to-addresses=TRACCAR_LAN_IP \
    to-ports=5055
add action=dst-nat chain=dstnat comment="Traccar AiO Comm" dst-address=\
    ISP-WAN-IP dst-port=5001-5190 protocol=tcp to-addresses=TRACCAR_LAN_IP \
    to-ports=5001-5190
add action=dst-nat chain=dstnat comment="Traccar AiO Comm" dst-address=\
    ISP-WAN-IP dst-port=5001-5190 protocol=udp to-addresses=TRACCAR_LAN_IP \
    to-ports=5001-5190