I have a multiple interfaces that are network connected. I want to be able to configure routes for this so that no matter what is plugged in or connected it doesn't have to be restarted or any commands run on the command line. the problem I am running into is that whenever the Ethernet cable is unplugged the interface stays up. I either need that interface to go down or to be able to run a script that runs when it is unplugged so I can remove the route to that device.

This is my /etc/network//interfaces file

auto enp5s0f1
iface enp5s0f1 inet dhcp
  up route add default gw
  down route del default gw

auto enp5s0f2
iface enp5s0f2 inet static

iface tap0 inet static
        up route add -net netmask gw

iface ppp0 inet dhcp
  metric 10

Any help would be greatly appreciated.

  • I have already come across some cheap chinese ethernet chipsets do not go down...detail brand and model please. Feb 20 '18 at 17:36
  • The board I am using is a Gateworks Newport GW6304 if that's what you are asking
    – zlb323
    Feb 20 '18 at 17:39
  • Perhaps, just perhaps this may work, put this after the auto... line and before iface... line: allow-hotplug eth0 (change eth0 for your netword ID), this work for me in some old (veryyyyy old) and cheap pci network adapter.
    – k.Cyborg
    Feb 20 '18 at 18:19
  • I couldn't get that to work either unfortunately. I wonder if it would be possible to write a script that checks every so often and takes the ethernet down if there is no internet
    – zlb323
    Feb 20 '18 at 20:16

Your Answer

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

Browse other questions tagged or ask your own question.