Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Wireless wan (mobile broadband) configuration, netifrc

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

Wireless wan (mobile broadband) configuration, netifrc

  • Quote

Post by Zarhan » Mon Dec 04, 2017 10:48 am

Hi,

how are you supposed to configure a wireless WAN connection to a laptop (in this case a Thinkpad with Sierra Wireless WAN card)?

I can see that there's a network interface wwan0 with ifconfig. I would guess you can just do the standard ln -s net.lo net.wwan0 under init.d to get the networking script operational.

However, how do you bring that up once I get a SIM card in place? E.g.
- How to unlock the SIM (send PIN)
- How to read SMS

and so on.

I can create and acpid script/action to bind bringing up the interface to an Fn key, so no problem there.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Mon Dec 04, 2017 6:19 pm

You probably need to install and configure net-dialup/ppp. For SMS look at app-mobilephone/smstools.
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Mon Dec 04, 2017 7:58 pm

Already have those, but it seems that there really is no interface for accessing the AT command interface of the modem. There are no /dev/ttyUSBX devices present.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

Re: Wireless wan (mobile broadband) configuration, netifrc

  • Quote

Post by charles17 » Tue Dec 05, 2017 4:35 am

Zarhan wrote:how are you supposed to configure a wireless WAN connection to a laptop (in this case a Thinkpad with Sierra Wireless WAN card)?
Would you please show us how that card appears in dmesg, lsusb, lspci, ifconfig -a, ...?
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Tue Dec 05, 2017 6:50 am

This is pretty much it. The options mentioned in the wikilink are installed.

lsusb:

Code: Select all

Bus 001 Device 007: ID 1199:9079 Sierra Wireless, Inc. 
dmesg:

Code: Select all

[    1.617693] usbcore: registered new interface driver cdc_ncm
[    1.617700] usbcore: registered new interface driver cdc_mbim
[    1.621754] usbcore: registered new interface driver cdc_acm
[    1.621755] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    1.621761] usbcore: registered new interface driver cdc_wdm
[    5.056619] cdc_mbim 1-6:1.12: cdc-wdm0: USB WDM device
[    5.056720] cdc_mbim 1-6:1.12 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-6, CDC MBIM, 3a:15:28:0b:c5:79
[    5.405493] usbcore: registered new interface driver qcserial
[    5.405499] usbserial: USB Serial support registered for Qualcomm USB modem
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56106
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 05, 2017 10:38 am

Zarhan,

You need some of this

Code: Select all

config USB_NET_QMI_WWAN
        tristate "QMI WWAN driver for Qualcomm MSM based 3G and LTE modems"
        depends on USB_USBNET
        select USB_WDM
        help
          Support WWAN LTE/3G devices based on Qualcomm Mobile Data Modem
          (MDM) chipsets.  Examples of such devices are
            * Huawei E392/E398

          This driver will only drive the ethernet part of the chips.
          The devices require additional configuration to be usable.
          Multiple management interfaces with linux drivers are
          available:

            * option: AT commands on /dev/ttyUSBx
            * cdc-wdm: Qualcomm MSM Interface (QMI) protocol on /dev/cdc-wdmx

          A modem manager with support for QMI is recommended.

          To compile this driver as a module, choose M here: the
          module will be called qmi_wwan.
Do you have /dev/ttyUSBx so you can use AT commands to gen the link up or /dev/cdc-wdmx so you can use the proprietary protocol?
The conventional setup is AT commands over the serial link to cover unlocking the SIM, dialling and authenticating , then start PPP to use Ethernet on the link.

-- edit --

Code: Select all

 * option: AT commands on /dev/ttyUSBx
As a wild guess, I think that refers to the kernel module named option.
I need that for my USB 3G dongle to get the serial ports.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Tue Dec 05, 2017 11:39 am

I had enabled USB_SIERRA_NET since that's supposed to be the driver. I now added the Qualcomm driver as well. Qcserial is now loaded at boot, and /dev/cdc-wdm0 device does appear. The ttyUSB devices are still missing.

The laptop is actually a Thinkpad T470, forgot to mention that.
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Tue Dec 05, 2017 11:42 am

Ok, looks like the ttyUSBX interfaces are not necessarily needed.

However, lots of links, eg. http://www.embeddedpi.com/documentation ... face-setup talk about qmiutils package, and that does not seem to be available for Gentoo. What to do now?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56106
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 05, 2017 11:46 am

Zarhan,

If you can find a tool to drive it /dev/cdc-wdm0 cam be used to establish the link. Its a proprietary protocol though.
If not, you need the USB serial devices. That probably needs

Code: Select all

CONFIG_USB_SERIAL_OPTION
in the kernel.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Tue Dec 05, 2017 12:46 pm

I have USB_SERIAL enabled (due to the fact that I have a USB to serial converter as well). I now added USB_SERIAL_GENERIC and USB_SERIAL_SIMPLE, as well as USB_SERIAL_QCAUX and USB_SERIAL_QUALCOMM, and also USB_SERIAL_SIERRAWIRELESS.

None of the above helped.
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Tue Dec 05, 2017 12:54 pm

Oh, turns out libqmi is actually included with Gentoo. I just had to enable use flag mbim.

So, I can control it at least with qmicli -d /dev/cdc-wdm0.

Thanks for all the pointers. Looks like this card does no longer even support the old serial interface.
Top
Zarhan
Veteran
Veteran
Posts: 1020
Joined: Fri Feb 27, 2004 4:42 pm

  • Quote

Post by Zarhan » Thu Mar 08, 2018 7:24 pm

Just in case someone else would need it, I got this thing streamlined.

I created a new network init script using standard method, that is ln -s net.lo net.wwan0.

Then, in /etc/conf.d/net, I added the following functions. I used this https://gist.github.com/ploth/556ef1620 ... b9fc570bb3 as a starting point. However, I opted to use modemmanager instead of mbim_cli to handle most of the low-level stuff. Only figuring out the IP and DNS parameters are from mbim_cli.

This assumes that modemmanager is running. The modemmanager package doesn't provide init script to start it as service, but one can use this one here:

viewtopic-p-7633094.html#7633094

Why I don't use networkmanager? Well, I want my network to be available before login.

Code: Select all

preup() {
  if [[ ${IFACE} == "wwan0" ]] ; then

    rfkill_device=$(rfkill list | grep tpacpi_wwan_sw | awk 'BEGIN { FS = ":" } ; { print $1 }')
    rfkill unblock ${rfkill_device}

    mmcli -m 0 --simple-connect="apn=internet"

    query=$(mbimcli -d /dev/cdc-wdm0 -p  --query-ip-configuration)
    squery=($query) #split into array elements

    ipv4=$(echo ${squery[10]} | sed s/\'//g)
    gwv4=$(echo ${squery[12]} | sed s/\'//g)
    d1v4=$(echo ${squery[15]} | sed s/\'//g)
    d2v4=$(echo ${squery[18]} | sed s/\'//g)
    ipv6=$(echo ${squery[31]} | sed s/\'//g)
    gwv6=$(echo ${squery[33]} | sed s/\'//g)
    d1v6=$(echo ${squery[36]} | sed s/\'//g)
    d2v6=$(echo ${squery[39]} | sed s/\'//g)

    if [[ $2 == '' || $2 == '4' ]]; then
      # ipv4
      ip addr add $ipv4 dev wwan0
      echo -e "nameserver $d1v4\nnameserver $d2v4" | resolvconf -a wwan0.lte
      # activate device
      ip link set wwan0 up
      ip route add default via $gwv4 metric 50
    elif [[ $2 == '6' ]]; then
      # ipv6
      ip addr add $ipv6 dev wwan0
      echo -e "nameserver $d1v6\nnameserver $d2v6" | resolvconf -a wwan0.lte
      # activate device
      ip link set wwan0 up
      ip route add default via $gwv6 metric 50
    fi  
  fi
}

predown() {
  if [[ ${IFACE} == "wwan0" ]] ; then
    mmcli -m 0 --simple-disconnect

    # deactivate device
    ip link set wwan0 down
    ip add flush dev wwan0
    resolvconf -d wwan0.lte
    mmcli -m 0 -d
    rfkill_device=$(rfkill list | grep tpacpi_wwan_sw | awk 'BEGIN { FS = ":" } ; { print $1 }')
    rfkill block ${rfkill_device}

  fi
}
Top
Maxwell
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 97
Joined: Wed Dec 10, 2003 1:06 pm

  • Quote

Post by Maxwell » Thu Jun 11, 2020 12:45 pm

Hi Zarhan

The gist provided is no longer available. Could you be so kind and provide your /etc/conf.d/net file?

Trying to use a Vodafone branded huawei e398 usb stick on a raspberry pi/arm sbc
Freedom works. Use it!
Linux, by Gentoo
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Fri Jun 12, 2020 4:03 am

Nowadays I'd recommend using net-misc/connman[+ofono] instead. It seems to be good at handling exotic dialup setups.
Top
Post Reply

14 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic