-1

I have two different default gateways for different network interfaces like below

Destination     Gateway         Genmask   Flags Metric Ref   Use  Iface
0.0.0.0         172.16.18.1     0.0.0.0   UG    10      0     0   wlp0s20f0u3
0.0.0.0         192.168.13.1    0.0.0.0   UG    5       0     0   enp3s0

The second one has low metric value and it means my active network interface is enp3s0.My queistion is that how to check internet connection using the first(passive) network interface when the second is active ? When i use the

ping -I wlp0s20f0u3 www.google.com 

It cannot ping google. But when i use

ping -I enp3s0 www.google.com 

I got the answer from ping. Why the first ping command is not working ?

Someone can help me ?

nihasmata
  • 652
  • 1
  • 8
  • 28

1 Answers1

0

I just solved my problem by the help of following link

https://www.thomas-krenn.com/en/wiki/Two_Default_Gateways_on_One_System

And now i am using ping -I wlp0s20f0u3 www.google.com when the enp3s0 interface is active.

nihasmata
  • 652
  • 1
  • 8
  • 28