You’ll probably have to provide the netmask info for us to review. If you’re using /24 then those all reside in the same network so I would expect them to be in the same broadcast domain.
If you have mismatched netmasks that could be trying to route traffic to the gateway which then reflects back. Ensure your devices have the same network, netmask and broadcast ip (e.g. 192.168.1.0/24 will have broadcast ip of 192.168.1.255)
IANAEE. For an on-board application you can create a simple switch with a transistor. https://www.electronics-tutorials.ws/transistor/tran_4.html
To make something wireless you’ll probably want to go with a microcontroller or Raspberry Pi and hook up GPIO pins to the motor controls. A transistor wouldn’t be needed in that case as the microcontroller can hold the pin high or low depending on what state you want.