Based on the stated physical and IP connections, you should be able to go from myDevice -> ComputerA -> ComputerB just by virtue of setting up myDevice to use the same gateway as computerA.
What's a gateway, you ask?
A gateway is an IP address that performs IPv4 Masquerading
, which means that it forwards packets from one IP address to another. Most router software does this automatically, so you would point myDevice at the router as the gateway in that case. But if the LAN is defined as a local network being hosted by ComputerA, then you will need to make ComputerA a gateway.
IPv4 Masquerading can be accomplished on Windows XP by following these instructions from a stable link to a Microsoft Knowledge Base article: http://support.microsoft.com/kb/315236
Once you have IPv4 Forwarding (masquerading) set up properly, all you should need to ensure is that:
ComputerA, ComputerB and myDevice are at least transitively physically connected, which means that A->B->C implies that A->C because you can use "B" as an intermediate hop (I changed the letters in my contrived example just to be simple/brief);
ComputerA, ComputerB and myDevice all share an IP space in common (which they do; the 192.168.1.0/24 space is shared because of the 255.255.255.0 netmask)
The three devices all have unique IPs within the shared IP address space;
There is a gateway device defined that will forward packets from devices that are not physically connected, because by default the only devices that will communicate over IP are devices that are physically connected at the link layer. This is why you need the gateway.
Devices which wish to communicate to other devices which are not physically connected to them have declared a gateway in their routing table, and the gateway is physically connected to the destination, or another gateway which (eventually) is physically connected to the destination by an arbitrary number of hops. In your example, this means that both myDevice and ComputerB need to declare computerA as a gateway.
If you're wondering about the invisible magical internals that cause myDevice
to "know" that ComputerA
is able to route packets to ComputerB
, take a look at the Address Resolution Protocol (ARP) on Wikipedia. ARP is as critical to the function of the internet as DNS.
1What are you referring to for adding routes? What kind of device is myDevice? If they are on the same network (192.168.1.x) they should be able to communicate if the gateway is correct. – user142485 – 2012-07-17T18:44:15.883