I am trying to connect 2 devices in different subnets.
Device 1: IP address: 172.20.35.1 netmask: 255.255.0.0 gateway: 172.20.1.1 Device 2: IP address: 172.20.100.100 netmask: 255.255.255.0 gateway: 172.20.100.1
The router has IP address
When I send a UDP datagram from device 1 to device 2, device 2 receives it but cannot reply, since the gateway IP address (device 2) is wrong.
But shouldn't the router be able to connect these 2 networks together as shown here http://www.eventhelix.com/realtimemantra/networking/ip_routing.htm#.VMo5Sx3n5Qs? Must the routes be manually configured?
Also: What if I change the network config of
device 2 as shown below?
Device 1: IP address: 172.20.35.1 netmask: 255.255.0.0 gateway: 172.20.1.1 Device 2: IP address: 192.168.170.100 netmask: 255.255.255.0 gateway: 192.168.170.1
With this network config,
device 2 never receives the UDP datagram. Why is that?
Just to clarify. I'm actually not a newbie. The described issue is known to me since many of my clients tend to configure their devices the way I described above and then end up unable to reach them per
TELNET. I managed to solve this issue by implementing a
multicast tunnel allowing the user to change the network configuration on the remote device using a
multicast UDP protocol, whenever they mess up the configuration as shown above. Anyway, I had an phone interview at a company and the manager said that traffic between such devices will always be possible, because that's what routers are for.
I was invited to a personal interview and I know that this question will come up again. So I posted this question here in order to help me formulate a better answer.