I have several devices talking to my Mosquitto MQTT broker and when listening to incoming messages I get all relevant information except the IP of the subscribed client.

Is it possible to configure Mosquitto so that this information is provided together with the topic and payload?

This is a possible security issue if the ACLs are not configured properly so I can understand that the feature is disabled by default. In my case security is not a concern.

  • The broker can discover the source address from the network connection and publish this as original traffic from a source co-located with the broker, thus literally meeting the text of your question. However you would probably have to modify the code or extend it by leveraging the existing plugin and client interfaces, in order to do so. Mar 21, 2018 at 4:51

1 Answer 1



MQTT is a lightweight protocol, it carries nothing in the headers except what is needed (Topic, QOS & Retained flag).

It also goes against the pub/sub philosophy that a publisher shouldn't know about who is subscribed to a given topic and a subscriber shouldn't care where the publisher is, just that the information was provided on a given topic.

The only way would be to add the information to the payload yourself.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.