I am running node red on an ubuntu server and I have configured one of the network adapters to have several IP addresses, like this:
network:
ethernets:
enp0s3:
dhcp4: true
enp0s8:
dhcp4: no
addresses:
- 192.168.25.9/24
- 192.168.25.23/24
- 192.168.25.43/24
- 192.168.25.45/24
- 192.168.25.67/24
version: 2
The idea is that I want to use node red to simulate several controllers, the different IP addresses corresponds to the controllers IP addresses.
In node red I am using an UDP out node to send packets and respond to heartbeat communication but I have not figured out a way to specifically send packets from for example IP 192.168.25.43
. I have read something about using the bind
call to specify source address but I have not managed to figure out how it works.
I found this post but I don't understand and if I try to code I get this error: TypeError: Cannot read properties of undefined (reading 'createSocket')