Xiang
Xiang

Reputation: 61

Question about ip Adresse of mosquitto Broker

I have a problem with the ip address of the mosquitto Broker. Currently I'm trying to get mosquitto Broker running locally. I used Siemens PLCSIM Virtual Ethernet Adapter as connection and set its ip address to 192.168.0.10. The version of mosquitto Broker I am using is 2.0.15. I added the following two lines of code in mosquitto.conf

listener 1883
allow_anonymous true

and enter the following command in command prompt

mosquitto.exe -c mosquitto.conf -v

After that when I tested the local connection, everything worked fine. The ip address of mosquitto Broker is the ip address of Siemens PLCSIM Virtual Ethernet Adapter, which is 192.168.0.10 I set before.

For example, I now have an actual plc and want to pass data through mosquitto Broker. Suppose the ip address of the network I am connected to is 192.168.0.103. I would like to ask, what should I do if I want to make mosquitto Broker run online instead of locally? Do I need to make any changes to the mosquitto.conf file? And if mosquitto Broker is running on the network, is the ip address of mosquitto Broker 192.168.0.103?

Upvotes: 2

Views: 8743

Answers (1)

hardillb
hardillb

Reputation: 59801

As configured mosquitto will bind to ALL the IP addresses on the machine it is running on, there is no need to change it's configuration at all.

You need to configure any MQTT clients that want to connect to the broker to user the IP address of what ever interface the machine running the broker is connected to the same subnet as the client device (assuming no routing is taking place)

Upvotes: 0

Related Questions