├── 99-usb-serial.rules ├── 99-wwan.rules ├── DW5550_F5521gw.sh ├── Huawei_ME909s-120.sh ├── Huawei_MU709s-2.sh ├── NETPLAN_Huawei_ME909s-120.sh ├── Novatel_Wireless_E371.sh ├── Qualcomm_Gobi2000.sh ├── README.md └── SIMCom_SIM7100.sh /99-usb-serial.rules: -------------------------------------------------------------------------------- 1 | # This file defines udev rules for some USB serial adapters. It 2 | # addresses the issue that the ttyUSB devices are numbered 3 | # randomly, and their numbering can vary between server reboots. These 4 | # rules create persistent symlinks for each serial port. 5 | 6 | # Copyright (c) 2016 Stanislav Sinyagin . 7 | 8 | # This content is published under Creative Commons Attribution 4.0 9 | # International (CC BY 4.0) lincense. 10 | 11 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 12 | 13 | 14 | # FTDI 15 | SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="ttyFTDI%s{devpath}" 16 | 17 | # Prolific Technology Inc. 18 | SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyPRLC%s{devpath}" -------------------------------------------------------------------------------- /99-wwan.rules: -------------------------------------------------------------------------------- 1 | # This file defines udev rules for some 3G/UMTS/LTE modems. It 2 | # addresses the issue that the ttyUSB devices are numbered randomly, and 3 | # their numbering can vary between server reboots. These rules create 4 | # persistent symlinks which can be reliably used in WWAN interface 5 | # startup scripts. 6 | 7 | # These rules assume that there is only one WWAN modem in the system. In 8 | # order to address multiple WWAN cards, the rules need to be more 9 | # specific and associate with serial numbers of the modems. 10 | 11 | # Copyright (c) 2016 Stanislav Sinyagin . 12 | 13 | # This content is published under Creative Commons Attribution 4.0 14 | # International (CC BY 4.0) lincense. 15 | 16 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 17 | 18 | # Huawei ME909s-120 LTE modem 19 | SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15c1", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}" 20 | SUBSYSTEM=="net", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15c1", NAME="lte0" 21 | 22 | # Huawei MU709s-2 UMTS modem 23 | SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1c25", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}" 24 | SUBSYSTEM=="net", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1c25", NAME="umts0" 25 | 26 | # Qualcomm Gobi2000 27 | SUBSYSTEM=="tty", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="251d", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}" 28 | 29 | # Sierra Wireless MC8775 30 | SUBSYSTEM=="tty", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1e1d", SYMLINK+="ttyWWAN%E{.ID_PORT}" 31 | 32 | # Novatel Wireless, Inc. Expedite E371 33 | SUBSYSTEM=="tty", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="819b", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}" 34 | 35 | # SIMCom SIM7100 36 | SUBSYSTEM=="tty", ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}" 37 | SUBSYSTEM=="net", ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", NAME="lte0" 38 | 39 | -------------------------------------------------------------------------------- /DW5550_F5521gw.sh: -------------------------------------------------------------------------------- 1 | # Setting up a Dell DW5550 (or Ericsson F5521gw) WWAN card in 2 | # Debian 8. 3 | # Assuming that the PIN authentication is disabled on the SIM card. 4 | 5 | # Copyright (c) 2016 Stanislav Sinyagin . 6 | 7 | # This content is published under Creative Commons Attribution 4.0 8 | # International (CC BY 4.0) lincense. 9 | 10 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 11 | 12 | # The kernel installs the TTY devices as /dev/ttyACM[012], so there's no 13 | # need to set up udev rules to recognize the modem from other ttyUSB 14 | # devices. 15 | 16 | apt-get install -y ppp 17 | 18 | cat >/etc/chatscripts/sunrise.DW5550 <<'EOT' 19 | ABORT BUSY 20 | ABORT 'NO CARRIER' 21 | ABORT ERROR 22 | TIMEOUT 10 23 | '' AT+CFUN=1 OK 24 | \dAT+CGDCONT=1,"IP","internet" OK 25 | \d\d\dAT*ENAP=1,1 OK 26 | EOT 27 | 28 | cat >/etc/chatscripts/gsm_off.DW5550 <<'EOT' 29 | ABORT ERROR 30 | TIMEOUT 5 31 | '' AT+CFUN=4 OK 32 | EOT 33 | 34 | 35 | cat >/etc/network/interfaces.d/wwan0 <<'EOT' 36 | allow-hotplug wwan0 37 | iface wwan0 inet dhcp 38 | pre-up /usr/sbin/chat -v -f /etc/chatscripts/sunrise.DW5550 >/dev/ttyACM0 /dev/ttyACM0 . 5 | 6 | # This content is published under Creative Commons Attribution 4.0 7 | # International (CC BY 4.0) lincense. 8 | 9 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 10 | 11 | 12 | apt-get install -y ppp 13 | 14 | wget -O /etc/udev/rules.d/99-wwan.rules \ 15 | https://raw.githubusercontent.com/ssinyagin/wwan_udev_rules/master/99-wwan.rules 16 | 17 | cat >/etc/chatscripts/sunrise.HUAWEI <<'EOT' 18 | ABORT BUSY 19 | ABORT 'NO CARRIER' 20 | ABORT ERROR 21 | TIMEOUT 10 22 | '' ATZ 23 | OK 'AT+CFUN=1' 24 | OK 'AT+CMEE=1' 25 | OK 'AT\^NDISDUP=1,1,"internet"' 26 | OK 27 | EOT 28 | 29 | cat >/etc/chatscripts/gsm_off.HUAWEI <<'EOT' 30 | ABORT ERROR 31 | TIMEOUT 5 32 | '' AT+CFUN=0 OK 33 | EOT 34 | 35 | cat >/etc/network/interfaces.d/lte0 <<'EOT' 36 | allow-hotplug lte0 37 | iface lte0 inet dhcp 38 | pre-up /usr/sbin/chat -v -f /etc/chatscripts/sunrise.HUAWEI >/dev/ttyWWAN02 /dev/ttyWWAN02 . 5 | 6 | # This content is published under Creative Commons Attribution 4.0 7 | # International (CC BY 4.0) lincense. 8 | 9 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 10 | 11 | 12 | apt-get install -y ppp 13 | 14 | wget -O /etc/udev/rules.d/99-wwan.rules \ 15 | https://raw.githubusercontent.com/ssinyagin/wwan_udev_rules/master/99-wwan.rules 16 | 17 | cat >/etc/chatscripts/sunrise.HUAWEI <<'EOT' 18 | ABORT BUSY 19 | ABORT 'NO CARRIER' 20 | ABORT ERROR 21 | TIMEOUT 10 22 | '' ATZ 23 | OK 'AT+CFUN=1' 24 | OK 'AT+CMEE=1' 25 | OK 'AT\^NDISDUP=1,1,"internet"' 26 | OK 27 | EOT 28 | 29 | cat >/etc/chatscripts/gsm_off.HUAWEI <<'EOT' 30 | ABORT ERROR 31 | TIMEOUT 5 32 | '' AT+CFUN=0 OK 33 | EOT 34 | 35 | cat >/etc/network/interfaces.d/umts0 <<'EOT' 36 | allow-hotplug umts0 37 | iface umts0 inet dhcp 38 | pre-up /usr/sbin/chat -v -f /etc/chatscripts/sunrise.HUAWEI >/dev/ttyWWAN02 /dev/ttyWWAN02 . 5 | 6 | # This content is published under Creative Commons Attribution 4.0 7 | # International (CC BY 4.0) lincense. 8 | 9 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 10 | 11 | 12 | apt-get install -y ppp networkd-dispatcher 13 | 14 | wget -O /etc/udev/rules.d/99-wwan.rules \ 15 | https://raw.githubusercontent.com/ssinyagin/wwan_udev_rules/master/99-wwan.rules 16 | 17 | cat >/etc/chatscripts/sunrise.HUAWEI <<'EOT' 18 | ABORT BUSY 19 | ABORT 'NO CARRIER' 20 | ABORT ERROR 21 | TIMEOUT 10 22 | '' ATZ 23 | OK 'AT+CFUN=1' 24 | OK 'AT+CMEE=1' 25 | OK 'AT\^NDISDUP=1,1,"internet"' 26 | OK 27 | EOT 28 | 29 | cat >/etc/chatscripts/gsm_off.HUAWEI <<'EOT' 30 | ABORT ERROR 31 | TIMEOUT 5 32 | '' AT+CFUN=0 OK 33 | EOT 34 | 35 | mkdir -p /etc/networkd-dispatcher/configuring.d/ 36 | cat >/etc/networkd-dispatcher/configuring.d/lte0_configuring <<'EOT' 37 | #!/bin/sh 38 | if [ x$IFACE = 'xlte0' ]; then 39 | sleep 5 40 | /usr/sbin/chat -v -f /etc/chatscripts/sunrise.HUAWEI >/dev/ttyWWAN02 /etc/networkd-dispatcher/off.d/lte0_off <<'EOT' 46 | #!/bin/sh 47 | if [ x$IFACE = 'xlte0' ]; then 48 | /usr/sbin/chat -v -f /etc/chatscripts/gsm_off.HUAWEI >/dev/ttyWWAN02 /etc/netplan/90-lte0.yaml <<'EOT' 54 | network: 55 | version: 2 56 | renderer: networkd 57 | ethernets: 58 | lte0: 59 | dhcp4: yes 60 | dhcp6: yes 61 | ipv6-privacy: yes 62 | dhcp4-overrides: 63 | route-metric: 100 64 | dhcp6-overrides: 65 | route-metric: 100 66 | EOT 67 | chmod 600 /etc/netplan/90-lte0.yaml 68 | 69 | 70 | -------------------------------------------------------------------------------- /Novatel_Wireless_E371.sh: -------------------------------------------------------------------------------- 1 | # Setting up a Novatel Wireless, Inc. Expedite E371 WWAN card in 2 | # Debian 8. 3 | # Assuming that the PIN authentication is disabled on the SIM card. 4 | 5 | # Copyright (c) 2016 Stanislav Sinyagin . 6 | 7 | # This content is published under Creative Commons Attribution 4.0 8 | # International (CC BY 4.0) lincense. 9 | 10 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 11 | 12 | 13 | apt-get install -y ppp 14 | 15 | wget -O /etc/udev/rules.d/99-wwan.rules \ 16 | https://raw.githubusercontent.com/ssinyagin/wwan_udev_rules/master/99-wwan.rules 17 | 18 | cat >/etc/chatscripts/lte_on.E371 <<'EOT' 19 | ABORT BUSY 20 | ABORT 'NO CARRIER' 21 | ABORT ERROR 22 | TIMEOUT 10 23 | '' ATZ 24 | OK 'AT+CFUN=1' 25 | OK 'AT+CMEE=1' 26 | OK 'AT\$NWQMICONNECT=,,' 27 | OK 28 | EOT 29 | 30 | cat >/etc/chatscripts/lte_off.E371 <<'EOT' 31 | ABORT ERROR 32 | TIMEOUT 5 33 | '' AT\$NWQMIDISCONNECT OK 34 | AT+CFUN=0 OK 35 | EOT 36 | 37 | cat >/etc/network/interfaces.d/wwan0 <<'EOT' 38 | allow-hotplug wwan0 39 | iface wwan0 inet dhcp 40 | pre-up /usr/sbin/chat -v -f /etc/chatscripts/lte_on.E371 >/dev/ttyWWAN00 /dev/ttyWWAN00 . 5 | 6 | # This content is published under Creative Commons Attribution 4.0 7 | # International (CC BY 4.0) lincense. 8 | 9 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 10 | 11 | 12 | apt-get install -y ppp gobi-loader wvdial 13 | 14 | wget -O /etc/udev/rules.d/99-wwan.rules \ 15 | https://raw.githubusercontent.com/ssinyagin/wwan_udev_rules/master/99-wwan.rules 16 | 17 | mkdir /lib/firmware/gobi 18 | cd /lib/firmware/gobi 19 | wget --no-check-certificate -nd -nc https://www.nerdstube.de/lenovo/treiber/gobi/{amss.mbn,apps.mbn,UQCN.mbn} 20 | 21 | cat >/etc/wvdial.conf <<'EOT' 22 | [Dialer Defaults] 23 | Init1 = ATZ 24 | Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 25 | Init3 = AT+CGDCONT=1,"IP","internet" 26 | Phone = *99# 27 | New PPPD = yes 28 | Modem = /dev/ttyWWAN02 29 | Dial Command = ATDT 30 | Baud = 9600 31 | Username = '' 32 | Password = '' 33 | Ask Password = 0 34 | Stupid Mode = 1 35 | Compuserve = 0 36 | Idle Seconds = 0 37 | ISDN = 0 38 | Auto DNS = 1 39 | EOT 40 | 41 | cat >/etc/network/interfaces.d/ppp0 <<'EOT' 42 | auto ppp0 43 | iface ppp0 inet wvdial 44 | EOT 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | udev rules for some WWAN modems 2 | =============================== 3 | 4 | `99-wwan.rules` defines udev rules for some 3G/UMTS/LTE modems. It 5 | addresses the issue that the ttyUSB devices are numbered randomly, and 6 | their numbering can vary between server reboots. These rules create 7 | persistent symlinks which can be reliably used in WWAN interface startup 8 | scripts. 9 | 10 | These rules assume that there is only one WWAN modem in the system. In 11 | order to address multiple WWAN cards, the rules need to be more 12 | specific and associate with serial numbers of the modems. 13 | 14 | Also `99-usb-serial.rules` defines rules for some USB serial adapters, 15 | in order to create persistent symlinks for each serial port. 16 | 17 | 18 | Also Debian configuration instructionns are listed for some WWAN 19 | modems. They are made for Sunrise UMTS network in Switzerland, and you 20 | may need to modify the APN name for your network. 21 | 22 | 23 | 24 | 25 | Copyright (c) 2016 Stanislav Sinyagin . 26 | 27 | This content is published under Creative Commons Attribution 4.0 28 | International (CC BY 4.0) lincense. 29 | 30 | Source repository: https://github.com/ssinyagin/wwan_udev_rules 31 | 32 | -------------------------------------------------------------------------------- /SIMCom_SIM7100.sh: -------------------------------------------------------------------------------- 1 | # Setting up a Huawei SIMCom SIM7100 WWAN card in Debian 8 or 9. 2 | # Assuming that the PIN authentication is disabled on the SIM card. 3 | 4 | # Copyright (c) 2017 Stanislav Sinyagin . 5 | 6 | # This content is published under Creative Commons Attribution 4.0 7 | # International (CC BY 4.0) lincense. 8 | 9 | # Source repository: https://github.com/ssinyagin/wwan_udev_rules 10 | 11 | 12 | apt-get install -y ppp 13 | 14 | wget -O /etc/udev/rules.d/99-wwan.rules \ 15 | https://raw.githubusercontent.com/ssinyagin/wwan_udev_rules/master/99-wwan.rules 16 | 17 | cat >/etc/chatscripts/sunrise.SIM7100 <<'EOT' 18 | ABORT BUSY 19 | ABORT 'NO CARRIER' 20 | ABORT ERROR 21 | TIMEOUT 10 22 | '' 'AT+CFUN=1' 23 | OK 'AT+CMEE=0' 24 | OK 'AT+CGDCONT=1,"IP","internet"' 25 | OK '\dAT\$QCRMCALL=1,1' 26 | OK 27 | EOT 28 | 29 | cat >/etc/chatscripts/gsm_off.SIM7100 <<'EOT' 30 | ABORT ERROR 31 | TIMEOUT 5 32 | '' 'AT\$QCRMCALL=0,1' 33 | OK AT+CFUN=0 34 | OK 35 | EOT 36 | 37 | cat >/etc/network/interfaces.d/lte0 <<'EOT' 38 | allow-hotplug lte0 39 | iface lte0 inet dhcp 40 | pre-up /usr/sbin/chat -v -f /etc/chatscripts/sunrise.SIM7100 >/dev/ttyWWAN02 /dev/ttyWWAN02