ConnMan

   Connection Manager简称connman,connman是使用d-bus做为进程间通信机制来管理Linux网络链接的一种软件。在connman的d-bus接口中,有一个接口叫做service。该接口的全称为:net.connman.Service,自然是挂在net.connman上面的。做为net.connman.Service接口,它可以访问到network的细节以及用户偏好使用什么类型的网络(比如3g、wifi、wimax等等)。外部的程序就通过net.connman.Service的一堆Properties和Methods来实现它基本的功能。(可能诠释的不对,可能是整体的connman的功能)

核心的逻辑如下:connman维护一个信号标记并且将所有可能连接上的网络服务建成一个列表(分类成普通网络、用户喜欢的以及上次使用的网络)。做为网络服务,它可以是以太网设备,WIFI,WIMAX,或者是远程蓝牙设备(比如手机)。

这个列表的分类和排序是由connman内部实现,没必要由使用它的用户来决定怎么去将网络排序之类的。用户的决定(比如链接WIFI、关闭以太网等等)会通过connman实现,与此同时connman会重新对列表中的网络服务进行排序。

ConnMan is a command-line network manager designed for use with embedded devices and fast resolve times. It is modular through a plugin architecture, but has native DHCP and NTP support.

Contents

Installation

Install the connman package. wpa_supplicant and bluez are optional dependencies required for Wi-Fi and Bluetooth functionality respectively.

Before enabling connman.service, ensure any existing network configuration is disabled.

Desktop clients

  • cmst — Qt GUI for ConnMan.
https://github.com/andrew-bibb/cmst || cmstAUR
  • connman-ncurses — Simple ncurses UI for ConnMan; not all of connman functionality is implemented, but usable (with X or from terminal without X), see the wiki.
https://github.com/eurogiciel-oss/connman-json-client || connman-ncurses-gitAUR
  • connman-notify — Connman event notification client
https://github.com/wavexx/connman-notify || connman-notifyAUR[broken link: archived in aur-mirror]
  • ConnMan-UI — GTK3 client applet.
https://github.com/tbursztyka/connman-ui || connman-ui-gitAUR
  • connman_dmenu — Client/frontend for dmenu.
https://github.com/taylorchu/connman_dmenu || connman_dmenu-gitAUR
  • Econnman — Enlightenment desktop panel applet.
http://www.enlightenment.org || econnmanAUR
  • LXQt-Connman-Applet — LXQt desktop panel applet.
https://github.com/surlykke/lxqt-connman-applet || lxqt-connman-applet-gitAUR
  • qconnman-ui — Qt management interface used on O.S. Systems products
https://github.com/OSSystems/qconnman-ui || qconnman-ui-gitAUR[broken link: archived in aur-mirror]
  • connman-gtk — GTK client.
https://github.com/jgke/connman-gtk || connman-gtkAUR
  • gnome-extension-connman — Gnome3 extension for connman; it contains only some of the functionality without installing connman-gtk.
https://github.com/jgke/gnome-extension-connman || https://extensions.gnome.org/extension/981/connman-extension/

Usage

This article or section needs expansion.

Reason: Only Wired and Wi-Fi plugins are described. (Discuss in Talk:ConnMan#)

ConnMan has a standard command line client connmanctl. It can run in 2 modes:

  • In command mode commands are entered as arguments to connmanctl command, just like systemctl.
  • Interactive mode is started by typing connmanctl without arguments. Prompt will change to connmanctl> to indicate it is waiting for user commands, just like python interactive mode. The interactive mode supports tab completion, which makes finding the correct connection easy.

Wired

ConnMan will automatically handle wired connections.

Wi-Fi

Enabling and disabling wifi

To check if wifi is enabled you can run connmanctl technologies and check for the line that says Powered: True/False. To power the wifi on you can run connmanctl enable wifi or if you need to disable it you can run connmanctl disable wifi. Other ways to enable wifi could include using the Fn keys on the laptop to turn it on or running ip link set <interface> up.

Connecting to an open access point

The commands in this section show how to run connmanctl in command mode.

To scan the network connmanctl accepts simple names called technologies. To scan for nearby Wi-Fi networks:

$ connmanctl scan wifi

To list the available networks found after a scan run (example output):

$ connmanctl services
*AO MyNetwork               wifi_dc85de828967_68756773616d_managed_psk
OtherNET wifi_dc85de828967_38303944616e69656c73_managed_psk
AnotherOne wifi_dc85de828967_3257495245363836_managed_wep
FourthNetwork wifi_dc85de828967_4d7572706879_managed_wep
AnOpenNetwork wifi_dc85de828967_4d6568657272696e_managed_none

To connect to an open network, use the second field beginning with wifi_:

$ connmanctl connect wifi_dc85de828967_4d6568657272696e_managed_none
Tip: Network names can be tab-completed.

You should now be connected to the network. Check using ip addr or connmanctl state.

Connecting to a protected access point

For protected access points you will need to provide some information to the ConnMan daemon, at the very least a password or a passphrase.

The commands in this section show how to run connmanctl in interactive mode, it is required for running the agent command. To start interactive mode simply type:

$ connmanctl

You then proceed almost as above, first scan for any Wi-Fi technologies:

connmanctl> scan wifi

To list services:

connmanctl> services

Now you need to register the agent to handle user requests. The command is:

connmanctl> agent on

You now need to connect to one of the protected services. To do this easily, just use tab completion for the wifi_ service. If you were connecting to OtherNET in the example above you would type:

connmanctl> connect wifi_dc85de828967_38303944616e69656c73_managed_psk

The agent will then ask you to provide any information the daemon needs to complete the connection. The information requested will vary depending on the type of network you are connecting to. The agent will also print additional data about the information it needs as shown in the example below.

Agent RequestInput wifi_dc85de828967_38303944616e69656c73_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory ]
Passphrase?

Provide the information requested, in this example the passphrase, and then type:

connmanctl> quit

If the information you provided is correct you should now be connected to the protected access point.

Settings

Settings and profiles are automatically created for networks the user connects to often. They contain fields for the passphrase, essid and other information. Profile settings are stored in directories under /var/lib/connman/ by their service name. To view all network profiles run this command from root shell:

# cat /var/lib/connman/*/settings
Note: VPN settings can be found in /var/lib/connman-vpn/.

Technologies

Various hardware interfaces are referred to as Technologies by ConnMan.

To list available technologies run:

$ connmanctl technologies

To get just the types by their name one can use this one liner:

$ connmanctl technologies | awk '/Type/ { print $NF }'
Note: The field Type = tech_name provides the technology type used with connmanctl commands

To interact with them one must refer to the technology by type. Technologies can be toggled on/off with:

$ connmanctl enable technology_type

and:

$ connmanctl disable technology_type

For example to toggle off wifi:

$ connmanctl disable wifi
Warning: connman grabs rfkill events. It is most likely impossible to use rfkill or bluetoothctl to (un)block devices, yet hardware keys may still work.[1] Always use connmanctl enable|disable

Connection Manager简称connman的更多相关文章

  1. Remote Desktop Connection Manager

    通过Remote Desktop Connection Manager(RDCMan),当前最新版本是 v2.7. 通过这款软件,我们便可以轻松的管理和访问数个RDP.左边的列表中我们可以创建总的分区 ...

  2. vpn找不到设备,win7建立新的VPN总时显示错误711,无法启动 Remote Access Connection Manager 及 Remote Access Auto Connection Manager 错误1068

    试试相关服务!一.remote access connection manager是网络连接的服务,它依赖于Technology服务,现在你的这个服务已经启动,而Secure Socket Tunne ...

  3. Remote Desktop Connection Manager (RDCMan)

    当前最新版本是 v2.7. 通过这款软件,我们便可以轻松的管理和访问数个RDP.左边的列表中我们可以创建总的分区列表(即 RDCMan Group),该列表保存采用的是RDG扩展名,使用时通过&quo ...

  4. Remote Desktop Connection Manager (RDCMan) 介绍

    Remote Desktop Connection Manager介绍 Remote Desktop Connection Manager (RDCMan) 是微软Windows Live体验团队的主 ...

  5. Remote Desktop Connection Manager介绍

    Remote Desktop Connection Manager (RDCMan) 是微软Windows Live体验团队的主要开发者 Julian Burger开发的一个远程桌面管理工具.简称为R ...

  6. Remote Desktop Connection Manager 多个远程管理

    http://www.microsoft.com/en-us/download/details.aspx?id=21101 Remote Desktop Connection Manager 多个远程 ...

  7. openfire研究之部署连接管理器(connection manager)

    http://blog.sina.com.cn/s/blog_7325f5150101bafh.html 一. Openfire Connection Manager 简介 Openfire Conn ...

  8. [OS] 修改屏幕分辨率(用Remote Desktop Connection 或者 用工具:Remote Desktop Connection Manager)

    用Remote Desktop Connection Remote Desktop Connection Manager

  9. Mismatched locale IDs. The component locale ID (2052) does not match the connection manager locale ID (2057)

    Snapshot: When using the 'Flat File Source' and 'OLE DB Destination' or something else components to ...

随机推荐

  1. CentOS8/Windows 安装RabbitMQ

    Centos8安装rabbitmq 1.安装erlang(rabbitmq是用erlang语言开发的,erlang版本需要22.x以上) yum install erlang 2.下载rabbitmq ...

  2. asp.net webapi 给字段赋初始值DefaultValue 解决前端传空字符串后台接受不是“”而是NULL

    /// <summary> /// 存储ID /// </summary> public Guid SaveID { get; set; } /// <summary&g ...

  3. MySQL管理基础

    #1.数据库连接管理 mysql命令说明 第一个功能:连接数据库(在前面mysql命令的使用里面讲解了,这里就不讲解了) 第二个功能:mysql客户端自带的命令功能 mysql命令的使用(mysql ...

  4. 《深入理解 Java 虚拟机》读书笔记

    第二章 Java 内存区域与内存溢出溢出 程序计数器 程序计数器是一块较小的内存空间,它可以看作是当前线程所执行的字节码的行号指示器.字节码解释器工作时就是通过改变这个计数器的值来选取下一条需要执行的 ...

  5. 使用maven创建java项目是,jdk的版本默认为1.5,如何修改为1.8

    <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> ...

  6. Q227 Basic Calculator II

    /* 看的答案,设置一个符号变量记录这个数前边的符号是什么,不同的符号进行不同的操作.这点自己想到了. 没想到的是由于乘除相当于一个优先级高的线程,所以要先处理,还有存取前一个乘数或者分子,应该怎么办 ...

  7. VS2015配置环境支持opencv3库(网络方法总结)

    今天安装了opencv3.4.1的版本,之前一直是在ubuntu上做的,本次在windows10上使用VS2015来开发. VS2015是之前安装的,能正常的编译程序. 1. 安装opencv,下载o ...

  8. Java学习日报7.23

    import java.util.Scanner;public class LandP {public static void main(String args[]) { System.out.pri ...

  9. Win10下mysql5.5和mysql8.0.19共存

    Win10下mysql5.5和mysql8.0.19共存 需求:由于之前做的项目用的是mysql5.5,而新接的项目指定用mysql8,需要myql5..5和8同时存在运行. 前提:电脑已经安装mys ...

  10. 痞子衡嵌入式:MCUXpresso IDE下添加新路径下源文件进工程编译的方法

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是MCUXpresso IDE下添加新路径下源文件进工程编译的方法. 接着上篇文章 <MCUXpresso IDE下SDK工程导入与 ...