Can't get mosquitto broker to accept external connections

I have installed mosquitto and Mosquitto-clients on ubuntu, and everything works fine LOCALLY on localhost, but as soon as I try to connect from a remote machine I get “operation timed out”.

My port is opened and not blocked by any firewall.

mosquitto.conf file:

listener 1883
allow_anonymous true

what’s the issue? any help?

Have you checked that the port is reachable at all from the clients using telnet or netcat or similar tools?

$ telnet server 1883
Connected to
Escape character is '^]'.
[me pressing ^D]
Connection closed by foreign host.

On the server /var/log/mosquitto/mosquitto.log will show:

May 25 13:55:00 iac mosq: New connection from on port 1883.
May 25 13:55:02 iac mosq: Client <unknown> disconnected due to protocol error.