In my example I passed the IP address as a string "192.168.1.100" in msg.payload.
[{"id":"d04192770059b0e9","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"a8a44d75fc130cd5","type":"inject","z":"d04192770059b0e9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"192.168.1.11","payloadType":"str","x":290,"y":160,"wires":[["931a276b1c3aec01"]]},{"id":"931a276b1c3aec01","type":"function","z":"d04192770059b0e9","name":"function 8","func":"const broker = msg.payload\nmsg.broker = {\n \"broker\": broker,\n \"username\": \"pie\",\n \"password\": \"chickenandmushroom\",\n \"port\":1883,\n \"force\": true\n}\nmsg.action = \"connect\"\nmsg.topic = \"test\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":160,"wires":[["3b0980807031b9fb"]]},{"id":"3b0980807031b9fb","type":"mqtt in","z":"d04192770059b0e9","name":"","topic":"","qos":"2","datatype":"auto-detect","broker":"a212f2307397ae96","nl":false,"rap":true,"rh":0,"inputs":1,"x":610,"y":160,"wires":[[]]},{"id":"a212f2307397ae96","type":"mqtt-broker","name":"","broker":"192.168.1.100","port":"1883","clientid":"","autoConnect":false,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]