Using Two MQTT Brokers with Broker Bridging

I wanted to try out the bridging features of Mosquitto and it turned out to be really easy! Made a walkthrough on how to get started using an MQTT broker running on Digital Ocean and a second MQTT broker on my network. All the messages on my external broker are automatically bridged to my local one.

Let me know if you’re doing something similar in your setup and any good use cases you’ve come up with!

There was a similar example of MQTT bridging posted recently. The external MQTT Broker was hosted by Adafruit (free) and offered the ability to integrate with IFTTT (because IFTTT supports Adafruit’s services):

What I’d like to see is a tutorial explaining how to secure the connection between the two MQTT brokers. As it stands, no encryption is employed and all messages move through the Internet in the clear.

Yes, in my example there is no encryption on the mqtt bridge for simplicity. The bridge connection can be easily encrypted with ssl between your private broker and Adafruit as both support ssl connections. The port numbers will be different and your mosquitto conf needs to reference your cert files but that is all well documented in the mosquitto configuration man pages.
Brian

An example of what can happen if you do not secure your MQTT access

It really is not very helpful to anyone to write a blog about a configuration that you should never actually use.

Thanks for the feedback. Agreed encryption is important here and definitely worth implementing. I’ll look at updating the article or doing a follow on to help people get it set up. For what it’s worth, I did at least show how to password protect the external broker and how to authenticate with it. But adding encryption is the logical next step.

1 Like