eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.93k stars 2.37k forks source link

how to configuration setup broker IP address in mosquito.conf file ? #2765

Open mintheinwin opened 1 year ago

mintheinwin commented 1 year ago

My broker IP address 192.168.1.1

I want to connect mosquito with broker ip instead of "test.mosquitto.org".

how to configuration setup broker IP address in mosquito.conf file ?

ptjm commented 1 year ago

It's not clear to me whether you want to have mosquitto send messages to another broker at 192.168.1.1 or you want to set mosquitto up to listen at 192.168.1.1.

To listen at a specific IP address, use the listener directive:

listener 1883 localhost

to send messages to a broker, you need to set up a bridge. You need to make some choices: the client IDs you want to use on each side of the bridge, the topics you want to send and receive, and the name of the connection. Anything with "my" in it here is a name you can define in a way that makes sense to you:


address 192.168.1.1:1883
topic mybroker.topic both
local_clientid mybroker-client
remote_clientid mymosquitto-client```