I have installed mosquitto broker in a Ubuntu VM Instance of Google Cloud . I can also see the broker running on port 1883 of the VM . The external IP of the VM is 130.211.173.165 . Now when i try to create a client for this broker by the command
client.connect_async("130.211.173.165",1883,60)
I get an error message saying that the connection was actively refused by the remote IP .
I have also added a network firewall rule stating the below but nothing seems to work.
Source Ranges:
0.0.0.0/0
Allowed Protocols or Ports:
tcp:1883
Can someone help here ?