60 | | Sample set of commands for Ventana Ubuntu Bionic: |
61 | | {{{ |
62 | | systemctl stop ModemManager #Stop modem manager, doing things manually |
63 | | ifdown eth0 #bring down eth0 so not confused for WAN/LAN link. |
64 | | |
65 | | echo "APN=ATT.APNI" > /etc/qmi-network.conf #replace with appropriate APN |
66 | | echo "PROXY=yes" >> /etc/qmi-network.conf # add prox |
67 | | qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=raw-ip #set raw ip format |
68 | | qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip #set raw ip format |
69 | | qmi-network /dev/cdc-wdm0 start #start the interface |
70 | | |
71 | | qmicli --device /dev/cdc-wdm0 --wds-get-current-settings #retrieve IP address information |
72 | | |
73 | | ifconfig wwan0 100.22.44.187 netmask 255.255.255.248 #assign IP |
74 | | route add default gw 100.75.76.188 wwan0 #assign route |
75 | | echo "nameserver 198.224.182.135" > /etc/resolv.conf #assign nameserver |
| 60 | Examples: (set APN env var appropriately) |
| 61 | * Ubuntu using !NetworkManager: |
| 62 | {{{#!bash |
| 63 | root@xenial-newport:~# nmcli --version |
| 64 | nmcli tool, version 1.2.6 |
| 65 | root@xenial-newport:~# nmcli connection down id 'Wired connection 1' |
| 66 | Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0) |
| 67 | root@xenial-newport:~# nmcli connection add type gsm ifname cdc-wdm0 con-name mymodem apn $APN |
| 68 | Connection 'mymodem' (1c6d1b7f-2c89-4e21-93ee-231073605578) successfully added. |
| 69 | root@xenial-newport:~# nmcli connection up id mymodem |
| 70 | Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3) |
| 71 | root@xenial-newport:~# ifconfig wwan0 |
| 72 | wwan0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 |
| 73 | inet addr:100.75.76.187 P-t-P:100.75.76.187 Mask:255.255.255.248 |
| 74 | UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 |
| 75 | RX packets:581 errors:0 dropped:0 overruns:0 frame:0 |
| 76 | TX packets:676 errors:0 dropped:0 overruns:0 carrier:0 |
| 77 | collisions:0 txqueuelen:1000 |
| 78 | RX bytes:354005 (354.0 KB) TX bytes:54090 (54.0 KB) |
| 79 | |
| 80 | root@xenial-newport:~# ping -c2 www.google.com |
| 81 | PING www.google.com (216.58.192.196) 56(84) bytes of data. |
| 82 | 64 bytes from ord30s25-in-f196.1e100.net (216.58.192.196): icmp_seq=1 ttl=52 time=568 ms |
| 83 | 64 bytes from ord30s25-in-f196.1e100.net (216.58.192.196): icmp_seq=2 ttl=52 time=188 ms |
| 84 | |
| 85 | --- www.google.com ping statistics --- |
| 86 | 2 packets transmitted, 2 received, 0% packet loss, time 1000ms |
| 87 | rtt min/avg/max/mdev = 188.688/378.624/568.561/189.937 ms |
| 88 | }}} |
| 89 | * Ubuntu using !ModemManager: |
| 90 | {{{#!bash |
| 91 | root@xenial-newport:~# mmcli --modem 0 |
| 92 | |
| 93 | /org/freedesktop/ModemManager1/Modem/0 (device id '5cbc1489609fb1b95308ccf41b45f14e0f57771d') |
| 94 | ------------------------- |
| 95 | Hardware | manufacturer: 'u-blox' |
| 96 | | model: 'SARA-R410M-52B' |
| 97 | | revision: 'L0.0.00.00.06.05 1 [Aug 01 2018 14:05:07]' |
| 98 | | H/W revision: '10000' |
| 99 | | supported: 'lte' |
| 100 | | current: 'lte' |
| 101 | | equipment id: '357812090840163' |
| 102 | ------------------------- |
| 103 | System | device: '/sys/devices/platform/soc@0/848000000000.pci/pci0000:00/0000:00:10.0/usb1/1-1/1-1.3/1-1.3.3' |
| 104 | | drivers: 'option1, qmi_wwan' |
| 105 | | plugin: 'Generic' |
| 106 | | primary port: 'cdc-wdm0' |
| 107 | | ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwan0 (net)' |
| 108 | ------------------------- |
| 109 | Numbers | own : '16127498744' |
| 110 | ------------------------- |
| 111 | Status | lock: 'sim-pin2' |
| 112 | | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)' |
| 113 | | state: 'disabled' |
| 114 | | power state: 'on' |
| 115 | | access tech: 'unknown' |
| 116 | | signal quality: '0' (cached) |
| 117 | ------------------------- |
| 118 | Modes | supported: 'allowed: 4g; preferred: none' |
| 119 | | current: 'allowed: 4g; preferred: none' |
| 120 | ------------------------- |
| 121 | Bands | supported: 'eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-8, eutran-12, eutran-13, eutran-17, eutran-18, eutran-19, eutran-20, eutran-39' |
| 122 | | current: 'eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-8, eutran-12, eutran-13, eutran-17, eutran-18, eutran-19, eutran-20, eutran-39' |
| 123 | ------------------------- |
| 124 | IP | supported: 'ipv4, ipv6, ipv4v6' |
| 125 | ------------------------- |
| 126 | 3GPP | imei: '357812090840163' |
| 127 | | enabled locks: 'none' |
| 128 | | operator id: 'unknown' |
| 129 | | operator name: 'unknown' |
| 130 | | subscription: 'unknown' |
| 131 | | registration: 'unknown' |
| 132 | | EPS UE mode: 'csps-2' |
| 133 | ------------------------- |
| 134 | SIM | path: '/org/freedesktop/ModemManager1/SIM/0' |
| 135 | |
| 136 | ------------------------- |
| 137 | Bearers | paths: 'none' |
| 138 | |
| 139 | root@xenial-newport:~# mmcli --modem 0 | grep imei |
| 140 | 3GPP | imei: '357812090840163' |
| 141 | root@xenial-newport:~# mmcli --modem 0 --enable |
| 142 | successfully enabled the modem |
| 143 | root@xenial-newport:~# mmcli --modem 0 --simple-connect="apn=$APN" # Note 'CallFailed' is likely an invalid APN |
| 144 | successfully connected the modem |
| 145 | root@xenial-newport:~# mmcli --modem 0 --bearer 0 |
| 146 | Bearer '/org/freedesktop/ModemManager1/Bearer/0' |
| 147 | ------------------------- |
| 148 | Status | connected: 'yes' |
| 149 | | suspended: 'no' |
| 150 | | interface: 'wwan0' |
| 151 | | IP timeout: '20' |
| 152 | ------------------------- |
| 153 | Properties | apn: 'NIMBLINK.GW12.VZWENTP' |
| 154 | | roaming: 'allowed' |
| 155 | | IP type: 'none' |
| 156 | | user: 'none' |
| 157 | | password: 'none' |
| 158 | | number: 'none' |
| 159 | | Rm protocol: 'unknown' |
| 160 | ------------------------- |
| 161 | IPv4 configuration | method: 'static' |
| 162 | | address: '100.75.76.187' |
| 163 | | prefix: '29' |
| 164 | | gateway: '100.75.76.188' |
| 165 | | DNS: '198.224.182.135', '198.224.183.135' |
| 166 | | MTU: '1428' |
| 167 | ------------------------- |
| 168 | IPv6 configuration | method: 'unknown' |
| 169 | ------------------------- |
| 170 | Stats | Duration: '0' |
| 171 | | Bytes received: 'N/A' |
| 172 | | Bytes transmitted: 'N/A' |
| 173 | root@xenial-newport:~# ifdown eth0 |
| 174 | Killed old client process |
| 175 | Internet Systems Consortium DHCP Client 4.3.3 |
| 176 | Copyright 2004-2015 Internet Systems Consortium. |
| 177 | All rights reserved. |
| 178 | For info, please visit https://www.isc.org/software/dhcp/ |
| 179 | |
| 180 | Listening on LPF/eth0/00:d0:12:0f:f5:83 |
| 181 | Sending on LPF/eth0/00:d0:12:0f:f5:83 |
| 182 | Sending on Socket/fallback |
| 183 | DHCPRELEASE on eth0 to 172.24.0.2 port 67 (xid=0x3cab7268) |
| 184 | Restarting ntp (via systemctl): ntp.service. |
| 185 | root@xenial-newport:~# ifconfig wwan0 100.75.76.187/29 |
| 186 | root@xenial-newport:~# route add default gw 100.75.76.188 |
| 187 | root@xenial-newport:~# echo "nameserver 198.224.182.135" > /etc/resolv.conf |
| 188 | root@xenial-newport:~# ping www.google.com |
| 189 | root@xenial-newport:~# ping -c2 www.google.com |
| 190 | PING www.google.com (216.58.192.196) 56(84) bytes of data. |
| 191 | 64 bytes from ord30s25-in-f196.1e100.net (216.58.192.196): icmp_seq=1 ttl=52 time=568 ms |
| 192 | 64 bytes from ord30s25-in-f196.1e100.net (216.58.192.196): icmp_seq=2 ttl=52 time=188 ms |
| 193 | |
| 194 | --- www.google.com ping statistics --- |
| 195 | 2 packets transmitted, 2 received, 0% packet loss, time 1000ms |
| 196 | rtt min/avg/max/mdev = 188.688/378.624/568.561/189.937 ms |
| 197 | }}} |
| 198 | * Ubuntu using libqmi only (no !NetworkManager or !ModemManager) |
| 199 | {{{#!bash |
| 200 | root@xenial-newport:~# qmicli --version |
| 201 | |
| 202 | qmicli 1.20.2 |
| 203 | Copyright (C) 2012-2018 Aleksander Morgado |
| 204 | License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html> |
| 205 | This is free software: you are free to change and redistribute it. |
| 206 | There is NO WARRANTY, to the extent permitted by law. |
| 207 | |
| 208 | root@xenial-newport:~# systemctl stop NetworkManager # don't conflict with NetworkManager |
| 209 | root@xenial-newport:~# systemctl stop ModemManager # don't conflict with ModemManager |
| 210 | root@xenial-newport:~# ifdown eth0 # bring down eth0 so not confused for WAN/LAN link. |
| 211 | root@xenial-newport:~# cat << EOF > /etc/qmi-network.conf |
| 212 | > APN=$APN |
| 213 | > PROXY=yes |
| 214 | > EOF |
| 215 | root@xenial-newport:~# qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=raw-ip |
| 216 | [/dev/cdc-wdm0] Successfully set data format |
| 217 | QoS flow header: no |
| 218 | Link layer protocol: 'raw-ip' |
| 219 | Uplink data aggregation protocol: 'disabled' |
| 220 | Downlink data aggregation protocol: 'disabled' |
| 221 | NDP signature: '0' |
| 222 | Downlink data aggregation max datagrams: '0' |
| 223 | Downlink data aggregation max size: '0' |
| 224 | root@xenial-newport:~# qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip |
| 225 | [/dev/cdc-wdm0] expected data format set to: raw-ip |
| 226 | root@xenial-newport:~# qmi-network /dev/cdc-wdm0 start |
| 227 | Loading profile at /etc/qmi-network.conf... |
| 228 | APN: NIMBLINK.GW12.VZWENTP |
| 229 | APN user: unset |
| 230 | APN password: unset |
| 231 | qmi-proxy: yes |
| 232 | Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format --device-open-proxy'... |
| 233 | Device link layer protocol retrieved: raw-ip |
| 234 | Getting expected data format with 'qmicli -d /dev/cdc-wdm0 --get-expected-data-format'... |
| 235 | Expected link layer protocol retrieved: raw-ip |
| 236 | Device and kernel link layer protocol match: raw-ip |
| 237 | Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=apn='NIMBLINK.GW12.VZWENTP' --client-no-release-cid --device-open-proxy'... |
| 238 | Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 4) |
| 239 | Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 2194536080) |
| 240 | Network started successfully |
| 241 | root@xenial-newport:~# qmicli --device /dev/cdc-wdm0 --wds-get-current-settings |
| 242 | [/dev/cdc-wdm0] Current settings retrieved: |
| 243 | IP Family: IPv4 |
| 244 | IPv4 address: 100.75.76.187 |
| 245 | IPv4 subnet mask: 255.255.255.248 |
| 246 | IPv4 gateway address: 100.75.76.188 |
| 247 | IPv4 primary DNS: 198.224.182.135 |
| 248 | IPv4 secondary DNS: 198.224.183.135 |
| 249 | MTU: 1428 |
| 250 | Domains: none |
| 251 | root@xenial-newport:~# ifconfig wwan0 100.22.44.187 netmask 255.255.255.248 # assign IP |
| 252 | root@xenial-newport:~# route add default gw 100.75.76.188 wwan0 # assign route |
| 253 | root@xenial-newport:~# echo "nameserver 198.224.182.135" > /etc/resolv.conf # assign nameserver |