Results 1 to 2 of 2
hi, i have a system with 2 interfaces eth0, and eth1. eth0 is 192.168.0.250 and connected to gateway 192.168.0.2. eth1 is connected to 22.214.171.124 via a swtich. i am trying ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-05-2012 #1
- Join Date
- Jul 2011
problem routing packets from one interface to another
hi, i have a system with 2 interfaces eth0, and eth1. eth0 is 192.168.0.250 and connected to gateway 192.168.0.2.
eth1 is connected to 126.96.36.199 via a swtich.
i am trying to route packets from 188.8.131.52 to gateway 192.168.0.2, which means i need to route 192.123.123.x packets coming into eth1 interface out via eth0 interface.
i set ip_forward file to 1.
i ran this command:
route add -net 184.108.40.206 netmask 255.255.255.0 dev eth0
route add default gw 192.168.0.2
i can ping from 220.127.116.11 to 192.168.0.250, but i can't ping to 192.168.0.2
i think packets are not being forwarded to eth0.
my routing table looks something like this:
gteway Genmask Flags Ref Iface
18.104.22.168 * 255.255.255.0 U eth1
192.168.0.0 * 255.255.255.0 U eth0
22.214.171.124 * 255.255.255.0 U eth0
default 192.168.0.2 0.0.0.0 UG eth0
can anyone tell me what is missing?
thank you in advance.
- 04-07-2012 #2
- Join Date
- Apr 2005
not totally sure what you are trying to do here.
_eth0:192.168.0.250<------->Default:192.168.0.2 (assuming a router here).
What is your switch connected to?
From the pc you should be able to ping either interface and also the default gateway.
Pinging the interfaces should always work as it never leaves the box itself.
Pinging the default gateway will only work out of the eth0 as it is directly connected.
If it is avaliable you should be able to ping it and see the arp address associated against eth0.
using arping is a good way to verify.
arping -I eth0 192.168.0.2
The route for the 126.96.36.199/16 out eith0 is not necessary unless you have another network in this range sitting behind the router.
The connected more specific netowork 188.8.131.52/24 out eth1 is what will be used.