1

Along with eth0 I have a ppp0. When there is no internet(by pinging 8.8.8.8) I have to turn on the ppp0 and it then results into 2 default gateways..So I have to delete default gateway of eth0 to get internet working and this creates second problem as I have deleted eth0 gateway I am not able to detect if eth0 internet is up! for that I have to again add the eth0 gateway! I tried using iproute 2 table but it didn't worked! I am using NanoPi Neo..running Ubuntu Core qt embedded

0

Does the sudo ifconfig eth0 down after connecting ppp solve your issue?

Edit: In order to be able to detect eth0 connection you will need to bring it up again and disconnect the ppp. I can imagine when having both interfaces up, it can be solved with route command to change the default gateway with

sudo ip route del default

sudo ip route add default via 192.168.1.1

where 192.168.1.1 is your new gateway - replace this ip address with your own one.

| improve this answer | |
  • But this will disable the eth0 so I have to add the gateway manually for eth0 after some time then keep checking if internet is up! This is not the ideal solution! – Tushar B Jan 13 '17 at 14:19
  • So is there a way I can delete the default gateway eth0 but will add it as a static route to check if it is up continuously? – Tushar B Jan 14 '17 at 6:34
  • I would use the ip route command before checking the connection with ping. Yes, it is possible to have both interfaces up. – kukulo Jan 16 '17 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.