Search code examples
azuremqttbroker

mqtt broker to outside world


I have a Virtual Machine in the cloud running Ubuntu (v20.04) on Azure, with the Mosquitto MQTT broker installed (v1.6.9). I can successfully ssh into the VM and using two instances I can pub and sub data, so I believe the Mosquitto configuration is ok. I have full sudo permissions for the VM but didn’t set it up, and have limited knowledge on this.

Question - What do I need to do on the VM to allow access from outside? (without having to ssh into the VM), i.e. how do I get the broker in VM to listen to remote devices?

So far I’ve opened port 1883 allowing in tcp traffic with ufc but this only appears to work for the localhost; running nmap from within the VM I get “22/tcp mqtt open” for localhost (127.0.0.1), and running nmap from outside using the VM’s IP address I get “22/tcp open for ssh” but that’s it. I was expecting to see something like, 1883/tcp open for mqtt.


Solution

  • The most likely problem here is that Azure has it's own Firewall as well as ufw.

    You need to look in your Azure console for security group