2
0
I have two devices (actually not PC). Device A is connected with external network, this IP is 192.168.1.2
, I use this as gateway.
Device B has two interfaces like below. Two interfaces use the same gateway, so I set it manually. ping test fails (ping -I eth0 www.google.com / ping -I eth1 www.google.com
)
What's wrong here?
eth0
IP : 192.168.1.1 mask : 255.255.255.252
eth1
IP : 192.168.1.11 mask : 255.255.255.248
Kernel IP routing table:
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.2 0.0.0.0 UG 0 0 0 eth0
default 192.168.1.2 0.0.0.0 UG 0 0 0 eth1
192.168.1.0 * 255.255.255.252 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.8 * 255.255.255.248 U 0 0 0 eth1
As you said, if I remove one, it works correctly. But it is working on only one interface. I hope that it can be used through different interface, if I try to connect different source IP using socket connection. – Victor – 2016-06-07T05:22:07.150
And I tested ping command, and captured and show pcap log. In log, outgoing and incoming packet is shown, but ping command is timeout about eth1. – Victor – 2016-06-07T05:24:01.410
What do you mean it is only working through one interface? The gateway only exists out of one interface. If you have other devices on 192.168.1.8 network, then you need to add routing to 192.168.1.2 to tell it to route packets for 192.168.1.8 via 192.168.1.1. Please edit your question and add more info. – Paul – 2016-06-07T05:31:22.250