Limit ports Traccar is listening to

Dan Dyse5 years ago

I understand that a "normal" installation will listen for all kind of trackers - listen on many different ports.
How can I limit it so it will only listen on the ports my devices use?

Anton Tananaev5 years ago

Remove ports that you don't need from default.xml.

Anonymous4 years ago

This is a very good question indeed. I am trying to make my traccar work via HTTPS, hence I would like to:

  • make traccar listen on 8082 and 5055 ports only from localhost (127.0.0.1), not from outside (0.0.0.0)
  • stop listening on all rest hundreds of ports

How do I do it exactly? Removing ports from default.xml just removes listening on them whatsoever.

Anton Tananaev4 years ago

You can use ***.address config parameters to limit interfaces.

Anonymous4 years ago

Thank you. It worked:

    <entry key='web.address'>127.0.0.1</entry>
    <entry key='web.port'>8082</entry>
    <entry key='web.path'>./web</entry>

    <entry key='osmand.address'>127.0.0.1</entry>
    <entry key='osmand.port'>5055</entry>

After restarting traccar, sudo netstat -tulpn command returns

tcp6       0      0 127.0.0.1:8082         :::*                    LISTEN      3335/java
tom-inkb3 years ago

I have a server with multiple interfaces ; i would like the 'osmand.address' binding to 1 IPv6 interface and 1 or maybe 2 IPv4 interfaces.
How can this be done without listening to all the interfaces ?

I tried multiple osmand.address keys and a space separated address list ; but that doesn't do the trick.

thanx !

Anton Tananaev3 years ago

No, you can only specify one or all.