I am setting up packet routing via a host computer. In order to try out a simple case. I set up a small local network of 3 linux PCs X,Y,Z. These 3 get their IP from a DLink router that I have. X,Y, Z can ping each other.
I want to route packets coming from X to Z via Y.
This must not need NAT I guess.
But even getting this simple routing doesn't seem to work.
Here are more details:
X: 192.168.0.100 y:192.168.0.3 Z:192.168.0.7
When X sends packets addressed to Y, Y should forward them to Z.
What iptable rules should I use?
Is it enough if I just setup a route command alone?
I tried on Y after setting ip_forward=1:
route add -host 192.168.0.7 gw 192.168.0.3
But I don't achieve the result. Please advise.
Should I change something on my D-link router?
And oh btw the catch is I have to achieve this by not changing anything on system X as it is not under my control.