I have two devices (actually not PC). Device A is connected with external network, this IP is, 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?


IP : mask :


IP : mask :

Kernel IP routing table:

Destination Gateway Genmask Flags Metric Ref Use Iface

default UG 0 0 0 eth0

default UG 0 0 0 eth1 * U 0 0 0 eth0 * U 0 0 0 eth1 * U 0 0 0 eth1

1 Answer 1


You have defined your gateway as being in two different places. You are saying that is it out of eth0 at (which is correct), but also out of eth1 at (which is incorrect). Not only is your gateway not available out of eth1, but the IP address isn't valid on that network.

Just remove the second gateway and it should work fine.

  • 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
    Jun 7, 2016 at 5:22
  • 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
    Jun 7, 2016 at 5:24
  • 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 network, then you need to add routing to to tell it to route packets for via Please edit your question and add more info.
    – Paul
    Jun 7, 2016 at 5:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .