I am trying to set up communication across a network, and I have run into a bit of a problem.
In the diagram below, why is it that I cannot ping host 2 from host 1? Router 1 has interfaces on both networks net1 and net2.
What rule do I have to add to the routing table to tell router 1 that it can access net 2 on its 2.250 interface?
I have tried
ip route add 192.168.2.0/24 via 192.168.2.250 but I get the error RTNETLINK : no such process.
Best Answer
You likely have a routing problem, but it probably isn't on R1 (which should know both subnets because they are directly connected). We wouldn't be able to confirm without knowing the router/host configurations and possibly the router vendor/model.
Having more than one router, each with distinct networks beyond it and not directly connected to the other routers, on the same subnet as hosts can be less than ideal. While it can work just fine, there are generally not "good" solutions to the problems that arise.
First, you do have to make sure that the each router knows about the networks beyond the other routers. Static routes are problematic as they are more difficult to maintain and prone to error. So this means running a routing protocol. (For the rest of my answer, I will assume that a routing protocol is running between the routers.)
Running a routing protocol on the routers on the same network where hosts are connected creates security implications. This can provide valuable information to an attacker (internal or external on compromised resource) about the network topography and subnets in use. Additional steps would be required to secure this.
Second, you have the issues associated with the hosts themselves. Typically hosts only have one "default" route or gateway where they will send all traffic destined to non-local subnets.
Here you have a number of options, none of them what I would consider "good":
So, what are alternatives? Well, if you go back to my statement early on in this post, there are a few things I could consider better options: