# How to set the default values of MQTT In and Out Nodes to known broker addresses and ports on node-red start up?

**URL:** <https://discourse.nodered.org/t/how-to-set-the-default-values-of-mqtt-in-and-out-nodes-to-known-broker-addresses-and-ports-on-node-red-start-up/61598>\
**Category:** General\
**Tags:** mqtt\
**Created:** [21 April 2022 13:27 UTC](https://discourse.nodered.org/t/how-to-set-the-default-values-of-mqtt-in-and-out-nodes-to-known-broker-addresses-and-ports-on-node-red-start-up/61598 "2022-04-21T13:27:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Shan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shan](https://discourse.nodered.org/u/Shan)\
**Post date:** [21 April 2022 20:48 UTC](https://discourse.nodered.org/t/how-to-set-the-default-values-of-mqtt-in-and-out-nodes-to-known-broker-addresses-and-ports-on-node-red-start-up/61598/3 "2022-04-21T20:48:38Z")

</div>

Thanks for this. I will try this and report back to this thread. I am aware of Dynamic Connections in MQTT based on [Dynamic MQTT node's "actions-\>connect" guidance needed - #2 by Steve-Mcl](https://discourse.nodered.org/t/dynamic-mqtt-nodes-actions-connect-guidance-needed/58878/2)

So based on your suggestion, and if I understand it correctly, if I pack the function (or even a change node as mentioned in the thread above) with a dynamic subscription MQTT in a subflow, it can then be made available as \_node\_itself for the end user?

## Edit

as mentioned by @bakman2 I created a pair of subflows for each mqtt broker (4 in total)

- internal mqtt broker in node
- internal mqtt broker out node
- external mqtt broker in node
- external mqtt broker out node

This make it easier for me to drag-and-drop specific mqtt brokers into the flow

---

_[View the full topic](https://discourse.nodered.org/t/how-to-set-the-default-values-of-mqtt-in-and-out-nodes-to-known-broker-addresses-and-ports-on-node-red-start-up/61598)._
