All,
first time here, not sure this is the right place but I hope you all indulge me.
I am in the process of developing a device which is controlled by a PC via TCP. I envision the device to contain a router.
If I connect my PC and the device to the same router on the AN side all is well. However, to network several devices to the same PC I will need the following topology:
PC ----- Main Router ----------- Device1 Router ---- Device 1
|
----------- Device2 Router -- Device 2
The devices are connected to the LAN ports on the Device routers, the device router WAN ports are connected to a LAN port on the Main Router as well as the PC. the main router's LAN is 192.168.1.0, the device routers use 10.0.69.0
Each device router has a static IP for the device and incoming traffic is routed to the device. It's WAN IP is obtained via DHCP from the main router.
I connect to the devices on ports 55001 and 55002 and this all works fine (port forwarding works after I figured out thanks to a post that I have to Masquerade the Lan -> WAN zones)
Here are the problems:
1) The PC sends a broadcast (255.255.255.255) on port 55100 using UDP and all devices are supposed to answer. I use this to discover what's out there (custom message, none of the established discovery protocols)
Problem: this packet never gets to my devices and the cannot answer. I tried to forward port 55100 also, doesn't work.
2) Each device is supposed to connect to the PC on a unique port (55003 - 55099) to be able to send messages to the PC. This does not work at all: when my code on device1 or device2 tries to connect a socket back to the device, I get an "unreachable host" exception.
I presume there is something with IP tables but I cannot figure it out.
Obviously, both, the main and device routers run OpenWrt.
If anybody has any ideas what's wrong and which - if any - custom firewall settings I might need, I would appreciate any help I can get.
Thanks