Udp out, eth0 interface

Hi there,

I’m trying to send udp broadcast message to ip address 255.255.255.255
I can see the message successfully comes out on the eth1 as this is where my router with internet location is located.

However I require the udp to be sent to eth0 which I have some hardware in need of communicating with.

How can i do this?

Also Im able to listen to broadcast messages just fine using udp in node just fine with packets from my special hardware.

This is a networking issue so not Node-RED dependent. Instead it will depend on your operating system. The issue is that your default route will be pointing to the internet which is probably what you want to maintain. Do you really need to broadcast to 255.255.255.255 ? You should be able to use the broadcast address of the subnet that eth0 is on ... eg 192.168.1.255 or 10.255.255.255 for example. (depending on the class of the subnet) and then it should go to that subnet instead.

Assuming that you are on a debian based OS then the command route will show you the mask to use for the interface. You may have to install the net-tools package.

sudo ip route add 255.255.255.255/32 dev eth0 worked for me nicely

1 Like

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