NMCLI设备不可用 [英] NMCLI device unavailable

查看:235
本文介绍了NMCLI设备不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在ubuntu核心16.04上配置带有蜂窝接口的新设备.我在其上运行了NMCLI软件包.在添加连接之前,我检查了接口

I am trying to configure a new unit with a cellular interface on ubuntu core 16.04. I have NMCLI package running on it. Before I added my connection I checked the Interfaces

# nmcli dev
DEVICE    TYPE      STATE         CONNECTION         
eth1      ethernet  connected     Wired connection 1 
wlan0     wifi      disconnected  --                 
eth0      ethernet  unavailable   --                 
cdc-wdm0  gsm       unavailable   --                 
lo        loopback  unmanaged     --     

我添加了我的连接:

nmcli con add type gsm ifname cdc-wdm0 con-name MyConnection apn myapn.com

最后,我尝试通过运行以下命令来建立连接:

Finally I have tried bringing connection up by running:

nmclil con up MyConnection 
Error: Connection activation failed: No suitable device found for this connection

我还粘贴了所应用的Config的输出:

Also I have pasted the output of the Config applied:

# nmcli -p con show MyConnection

                  Connection profile details (MyConnection)

connection.id:                          MyConnection
connection.uuid:                        25dc3eec-ca8a-4861-bfcc-089d558972d4
connection.interface-name:              cdc-wdm0
connection.type:                        gsm
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.timestamp:                   0
connection.read-only:                   no
connection.permissions:                 
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        -1 (default)

ipv4.method:                            auto
ipv4.dns:                               
ipv4.dns-search:                        
ipv4.dns-options:                       (default)
ipv4.addresses:                         
ipv4.gateway:                           --
ipv4.routes:                            
ipv4.route-metric:                      -1
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)

ipv6.method:                            auto
ipv6.dns:                               
ipv6.dns-search:                        
ipv6.dns-options:                       (default)
ipv6.addresses:                         
ipv6.gateway:                           --
ipv6.routes:                            
ipv6.route-metric:                      -1
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --

gsm.number:                             *99#
gsm.username:                           <hidden>
gsm.password:                           <hidden>
gsm.password-flags:                     0 (none)
gsm.apn:                                myapn.com
gsm.network-id:                         --
gsm.pin:                                <hidden>
gsm.pin-flags:                          0 (none)
gsm.home-only:                          no
gsm.device-id:                          --
gsm.sim-id:                             --
gsm.sim-operator-id:                    --

我的问题是如何启用不可用的设备,为什么它不可用?我可以检查些什么来帮助我解决问题.

My question is how do I enable the unavailable device and why is it unavailable? What can I check to help me resolve my issue.

任何帮助都会很棒,因为我只是从Snappy开始.

Any help would be great as I am only starting on Snappy.

推荐答案

好,所以我设法解决了自己的问题,我采取的步骤如下:

Ok, so I managed to resolve my own problem, the steps I took are as follows:

1)检查ubuntu核心是否已读取我网关上的调制解调器:

1) Check that the modem on my gateway is read by ubuntu core:

$ sudo mmcli -L

Found 1 modems:
    /org/freedesktop/ModemManager1/Modem/0 [Generic] MBIM [1519:0020]

2)检查SIM卡是否正确读取:

2) Check that the SIM is read correctly:

$ sudo mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id 'd8b328efa783ca35a022d6b44b878981e67a5903')
  -------------------------
  Hardware |   manufacturer: 'Generic'
           |          model: 'MBIM [1519:0020]'
           |       revision: 'MOD_6260_V05.1412.00_R07_VCTCX'
           |      supported: 'gsm-umts'
           |        current: 'gsm-umts'
           |   equipment id: '014752000020933'
  -------------------------
  System   |         device: '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3'
           |        drivers: 'cdc_acm, cdc_mbim'
           |         plugin: 'Generic'
           |   primary port: 'cdc-wdm0'
           |          ports: 'cdc-wdm0 (mbim), wwan0 (net), ttyACM0 (at)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'none'
           | unlock retries: 'sim-pin (3)'
           |          state: 'connected'
           |    power state: 'on'
           |    access tech: 'gprs'
           | signal quality: '67' (cached)
  -------------------------
  Modes    |      supported: 'allowed: 2g, 3g; preferred: none'
           |        current: 'allowed: 2g, 3g; preferred: none'
  -------------------------
  Bands    |      supported: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  3GPP     |           imei: '<censored>'
           |  enabled locks: 'fixed-dialing'
           |    operator id: '27203'
           |  operator name: 'IRL - METEOR'
           |   subscription: 'unknown'
           |   registration: 'home'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'

  -------------------------
  Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/0'

这是我意识到在网关中找不到我的SIM卡并且我的SIM卡已损坏的地方,我已经更换了SIM卡并提出了上面的输出.

This is where I realised that my SIM has not been found in the Gateway and I have a damaged SIM, I have changed my SIM card and came up with the output above.

3)配置新的APN或编辑现有的APN. (我发现重新添加连接更加容易)

3) Configure the new APN or edit existing one. (I found it easier to add the connection anew)

确保您位于root(sudo su -)

a)删除失败的现有连接

a)Delete existing connection that was failing

 #nmcli con delete MyConnection

b)创建新连接

#nmcli con add type gsm ifname cdc-wdm0 con-name MyWorkingConnection apn MyNewApn.com

4)在新连接中添加用户名和密码

4) Add username and password to the new connection

#nmcli con edit MyWorkingConnection

这时,您将进入nmcli>提示符.键入 help 以获得命令列表,以帮助您编辑连接.对我来说,我需要添加用户名和密码,因此我可以通过输入以下内容来实现:

At this point you will be in the nmcli> prompt. Type in help for list of commands to help you edit your connection. For me I needed to add username and password so I achieved that by typing in:

nmcli> set gsm.username data
nmcli> set gsm.password <passwordgoeshere>
nmcli> save
nmcli> quit

这时我的联系已经建立.我已经找到命令

At this point my connection has established. I have found the command

#nmcli m

在另一个会话中打开对于检查接口更改状态很有用.

open in another session being useful to check the state of the interface changing.

希望这对某些人有帮助!

Hope this helps some people!

这篇关于NMCLI设备不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆