# MQTT - Between 2 Ubuntu hosts in vmware

**URL:** <https://discourse.nodered.org/t/mqtt-between-2-ubuntu-hosts-in-vmware/45584>\
**Category:** General\
**Created:** [13 May 2021 10:16 UTC](https://discourse.nodered.org/t/mqtt-between-2-ubuntu-hosts-in-vmware/45584 "2021-05-13T10:16:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@alan](https://discourse.nodered.org/u/alan)\
**Post date:** [13 May 2021 10:16 UTC](https://discourse.nodered.org/t/mqtt-between-2-ubuntu-hosts-in-vmware/45584/1 "2021-05-13T10:16:47Z")

</div>

Hi friends,

I am new to MQTT. I am trying to setup MQTT between 2 ubuntu 18.x hosts installed in vmware. Both of these hosts has id address and I can even ping or ssh each other successfully.

Now in first Ubuntu host (machine 1 which i am going to use as publisher) i have installed mosquitto and mosquitto-clients and i see mosquitto running (command ps -e) and same installation is done on second ubuntu machine 2 (which i am going to use subscriber).

Now when i use below commands , i dont see message in the subscriber host.  
Machine2 \> mosquitto\_sub -h \<Machine 1 IPaddress\> -t test  
Machine1\> mosquitto\_pub -h \<Machine 2 IPaddress\> -t test -m "first message"

Nothing shows up in subscriber machine 2.  
I also used -d switch on publisher machine to see if any clue but didnt get any info.  
Any help to solve this problem will be of great help  
Thanks  
Alan

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 May 2021 10:28 UTC](https://discourse.nodered.org/t/mqtt-between-2-ubuntu-hosts-in-vmware/45584/2 "2021-05-13T10:28:36Z")

</div>

Do you know what version of mosquito is installed? As of version 2 it is defaulted to only accept connections from localhost. You need to modify the conf file. Quick search on this forum or the internet for mosquito 2 binding will reveal the answer.

PS you do only have one broker right?

---

<div class="post-metadata">

**Author:** ![alan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@alan](https://discourse.nodered.org/u/alan)\
**Post date:** [13 May 2021 11:09 UTC](https://discourse.nodered.org/t/mqtt-between-2-ubuntu-hosts-in-vmware/45584/3 "2021-05-13T11:09:07Z")

</div>

> [@Steve-Mcl](#):
>
> mosquito 2 binding

Thanks Steve..  
Just added 1 broker..  
and added allow\_anonyous true and , 'wola' all worked.. at least message worked. now need to configure security.

Thanks  
Alan

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 May 2021 11:09 UTC](https://discourse.nodered.org/t/mqtt-between-2-ubuntu-hosts-in-vmware/45584/4 "2021-05-27T11:09:42Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
