I currently have usb_modeswitch configured and working on my redhat box.

Problem Description:

When an interface is plugged into the USB port, by defauly it is added in the down staft. I must do an "ifup eth0" everything I hotplug the usb interface.

Currently my udev rules are :

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1f01 -J ; sleep 5s ; /usr/sbin/ifup eth0

The above rule executes properly when I plug in the device (usb Dongle) however the "ifup eth0" does not run at the end of the above rule.

If I manually run the command in bash it works fine.

any ideas ?

  • 1
    Udev kills any "long running" commands. And udev is generally not the place to start network configuration and other high level commands. If you're using ifupdown, you should add an allow-hotplug eth0 before the iface eth0 stanza, instead of trying to run ifup from udev. But the eth0 is a curious name for a USB interface -- what is your system, and what modifications have you made to it? – user431397 Oct 15 at 6:52
  • thanks for your reply. I am running a stripped down redhat RL7 linux. the USB interface I am using is a 4G dongle which shows up as eth0. according to RHEL documentation, /etc/sysconfig/network-scripts/ifcfg-eth0 should contain "HOTPLUG=yes". I have tried this but it still does not seem to work , interface still comes as down until I manually bring it up, any ideas ? – Haris Chaudhry Oct 15 at 22:59

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.