nx3d.org

XS4ALL mobile data on Linux using the command line

Keywords:

I recently bought a Thinkpad 480s which has a built-in WWAN modem. My Internet provider – XS4ALL – offers a free (up to 500MB monthly, throttled if you go over) data-only SIM card. The documentation on how to get started on Linux is rather sparse, so here’s a short how-to to get you started.

To list the available modems, run:

# mmcli -L

Found 1 modems:
/org/freedesktop/ModemManager1/Modem/0 [FIBOCOM] MBIM [2CB7:0210]

The modem index is the last number of the device path. To get detailed information on the state of the device, run:

# mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id '7de20...')
  -------------------------
  Hardware |   manufacturer: 'FIBOCOM'
           |          model: 'MBIM [2CB7:0210]'
           |       revision: '18300.1002.00.01.01.11'
           |   H/W revision: 'L830-EB-02 v1.0.1'
           |      supported: 'gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '800000000000222'
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6'
           |        drivers: 'cdc_mbim, cdc_acm'
           |         plugin: 'Generic'
           |   primary port: 'cdc-wdm0'
           |          ports: 'cdc-wdm0 (mbim), ttyACM0 (at), wwp0s20f0u6 (net)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'sim-pin'
           | unlock retries: 'sim-pin (3)'
           |          state: 'locked'
           |    power state: 'on'
           |    access tech: 'unknown'
           | signal quality: '0' (cached)
  -------------------------
  Modes    |      supported: 'allowed: 3g, 4g; preferred: none'
           |        current: 'allowed: 3g, 4g; preferred: none'
  -------------------------
  Bands    |      supported: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'

  -------------------------
  Bearers  |          paths: 'none'

The output of this command contains two important pieces of information. First, it shows that the SIM card is locked and requires entering the PIN to use. By default, the XS4ALL PIN is 0000. The SIM card can be unlocked by running mmcli -m 0 --pin=0000. Note that NetworkManager will do this for you, if you supply it with the PIN. You can also disable the pin (mmcli -m 0 --pin=0000 --disable-pin) or change it (mmcli -m 0 --pin=0000 --change-pin=9999) if you want.

The second important piece of information is the device listed under “primary port”. This is the device name you need to use when configuring the NetworkManager connection. For example, while I already have network interface called wwp0s20f0u6, I have to use cdc-wdm0.

Configure the connection using the settings provided by XS4ALL:

nmcli con add type gsm ifname cdc-wdm0 con-name xs4all \
    apn umts.xs4all.nl user xs4all password 1234 \
    gsm.pin 0000 autoconnect false

Since I use this connection only in case of backup, I’ve disabled autoconnect and run nmcli con up xs4all / nmcli con down xs4all to manage my connection. In any case, if you’ve enabled autoconnect or brought up the connection manually, you should now have a working connection!

  • Use nmcli device to check the state of the device/connection
  • Check the output of ip addr ls to check if you’ve been assigned an IP address
  • Use nmcli radio wwan off and nmcli radio wwan on to completely disable the radio
  • View the available networks using mmcli -m 0 --3gpp-scan --timeout=300