# MQTT connection in different network

**URL:** https://discourse.nodered.org/t/mqtt-connection-in-different-network/70300
**Category:** Industrial
**Created:** [9 November 2022 06:25 UTC](https://discourse.nodered.org/t/mqtt-connection-in-different-network/70300 "2022-11-09T06:25:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Rajan](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@Rajan](https://discourse.nodered.org/u/Rajan)
#### Post date: [9 November 2022 06:25 UTC](https://discourse.nodered.org/t/mqtt-connection-in-different-network/70300/1 "2022-11-09T06:25:27Z")

</div>

Hello. I am new to this IoT field. I want some suggestions from professional here to help me clear out my problem.

I have created a virtual machine in azure. Inside the VM, I installed node red. So the node red open under private IP which starts from 10.0.XXXXXXX

Then I install node red in raspberry pi too. The node red in raspberry pi start with local ip which is 192.168.XXXXX

So my problem is now, I want to send data from raspberry pi node red to azure virtual machine node red using MQTT. When I key in the ip address in MQTT, it cannot connect. So what I am missing here and what should I do now?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [9 November 2022 10:17 UTC](https://discourse.nodered.org/t/mqtt-connection-in-different-network/70300/2 "2022-11-09T10:17:48Z")

</div>

You haven't mentioned your MQTT broker running. Where is that running and what is it (mosquitto for example)?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 November 2022 15:50 UTC](https://discourse.nodered.org/t/mqtt-connection-in-different-network/70300/3 "2022-11-09T15:50:35Z")

</div>

> [@Rajan](#):
>
> I want some suggestions from professional here to help me clear out my problem.

Please also remember that any comments or suggestions in this forum should not be treated as profession advice.

> [@Rajan](#):
>
> So my problem is now, I want to send data from raspberry pi node red to azure virtual machine node red using MQTT. When I key in the ip address in MQTT, it cannot connect. So what I am missing here and what should I do now?

When using a global cloud service like Azure, the default configuration is that it is secure. Therefore, there are no routes between your local network and your Azure network.

You need to create a suitable route and the safest method is to use an Azure VPN.

---

<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: [8 January 2023 15:51 UTC](https://discourse.nodered.org/t/mqtt-connection-in-different-network/70300/4 "2023-01-08T15:51:28Z")

</div>

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