I have a system with two interfaces eth0 and eth1 .
eth0 is 192.168.0.250 and is connected to the 192.168.0.2 gateway.eth1 connects to 192.123.123.10 via swtich.
I am trying to route packets from 192.123.123.10 to the gateway 192.168.0.2 , which means that I need to route packets 192.123.123.x entering the eth1 interface through the eth0 interface.
I set the ip_forward file to 1 . I ran this command:
route add -net 192.123.0.0 netmask 255.255.255.0 dev eth0 route add default gw 192.168.0.2
I can ping from 129.123.123.10 to 192.168.0.250 , but I cannot ping before 192.168.0.2 I think that packets are not sent to eth0 .
My routing table looks something like this:
gteway Genmask Flags Ref Iface 192.123.123.0 * 255.255.255.0 U eth1 192.168.0.0 * 255.255.255.0 U eth0 192.123.0.0 * 255.255.255.0 U eth0 default 192.168.0.2 0.0.0.0 UG eth0
Can someone tell me what is missing? Thank you in advance.
source share