Skip to content

Instantly share code, notes, and snippets.

@holywen
Last active December 14, 2021 16:05
Show Gist options
  • Save holywen/1b1b54145e693e66a98d6d06e4306fe0 to your computer and use it in GitHub Desktop.
Save holywen/1b1b54145e693e66a98d6d06e4306fe0 to your computer and use it in GitHub Desktop.

Dependencies

  1. usb-modeswitch, usb-modeswitch-data
  2. libusb1
  3. libusb-devel(Fedora), libusb-dev(Debian based)

Configuration

By default, your linux box would register your Huawei E8372 as a Mass Storage device and not (somehow) as a modem. First, make sure you have the exace same device we're talking about. This can be confirmed by looking at 2 values. Give the following command (while the dongle is plugged in):

    sudo su
    lsusb | grep Huawei
  • Now look exactly for 12d1:1f01. Even if one letter is other than this, do not proceed.

  • Using your favourite editor, create a new file called 70-huawei_e8372.rules in /etc/udev/rules.d/ gedit /etc/udev/rules.d/70-huawei_e8372.rules

  • Paste the following piece of code in it, and save it:

     ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'"
     ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/bin/bash -c 'modprobe cdc_ether && echo 12d1 14db > /sys/bus/usb-serial/drivers/option1/new_id'"
    

- Finally, reload all the udev rules by:

    ```
    udevadm control --reload-rules
    ```
    
- Now Whenever you plug-in your dongle, you'll have it automatically registered as a ethernet device (e.g. eth1).

- Update /etc/network/interfaces
    `gedit /etc/network/interfaces`
    and add:
    ```
    allow-hotplug eth1
    iface eth1 inet dhcp
    ```
- Now restart your PC and you're good to go now.
@holywen
Copy link
Author

holywen commented Jan 18, 2017

Thanks to the original post from guseppiguliano:
https://gist.github.com/guseppiguliano/614055d0bc260f5ea305d71439a03790

@BeloborodovDS
Copy link

Worked for me on Raspberry Pi, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment