I have been asked to look at an interesting Linux routing issue and thought it worth sharing for comments. Both machines are running SuSE 11.2.
Machine A:
- IP Address 172.16.200.1 eth0
- Manual route added to specify that the route to network 192.168.192.0 is via eth0
Machine B:
- IP Address 192.168.192.100 eth0
- Manual route added to specify that the route to network 172.16.200.0 is via eth0
That's it; no more network configuration on the machines, no aliases on the NICs etc. Both machines are on an unmanaged switch.
The user has pointed out that the machines can only see each other intermittently and if PING stops working it can be 'fixed' by rebooting.
Now I am off to do some digging, but in my book this isn't the way to setup routing, but the customer insists they have done it this way many times before and it has always worked reliably. Sitting in front of these machines I can see them happily PINGing each other.
I am not after a tutorial on setting up routing (I know how I would have done it, and how it can be done with one NIC if you really really want) - my question is:
Has anyone else seen this type of setup used for routing before (ie: just a route add) as my understanding is that there is nothing in the above setup that should actually make routing work between the two networks!!?
My first thought is that luck is playing a big part in making the above configuration work.
The switch doesn't understand the IP protocol, the dialog has to happen between two different networks, without a gateway to perform any routing, and via the switch since both machines are on the same switch.
When A wants to "discuss" with B, since the route has been added directly via the eth0 interface and not a gateway, it first sends an ARP broadcast request via its eth0 interface
(if a gateway would have been mentioned, the gateway MAC address would be searched instead)
The switch naturally broadcasts the ARP request to all its ports, and B should get it.
B replies with its MAC address, and then A and B can communicate directly through the switch via their respective MAC addresses. The switch is able to "link" ports and MAC addresses, and no more broadcast has to take place to allow a communication between the machines (until they stop the dialog for some time).
It should work.