Routing problem
I have 3 Linux machines(Debian woody) A,B,C.
A and B are in same network.
C is in diffrent network.
I want to use B as the gateway for A for connecting to the C network.
-------------------------------------------------
A and B are in 192.168.1.0 network
A IPaddress - 192.168.1.2
Netmask 255.255.255.0
B IP address 192.168.1.1
Netmask 255.255.255.0
C is in 192.168.0.0 network
IP address -192.168.0.1
Netmask 255.255.255.0
Now I want to connect from 192.168.1.0 network to 192.168.0.0 network and vice versa.
For this In machine B I did a routing.
route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0
and in Machine C
route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0
done.Now i am able to ping from machine B to C.
No I want to use my Machine B as Gateway for A to access the other network.
For this In Machine A in the routing entry I added
route add -net 192.168.0.0 netmask 255.255.255.0 gateway 192.168.1.1 dev eth0.
But I cud not ping or ssh to C from A .From C also I cud not ping to A .But I can access Machine B .
Why?.Am i did anything wrong?.
|