Difference between revisions of "Connman"

From ArchWiki
Jump to: navigation, search
(Added section on using connmanctl with protected access points)
m (Article summary deletion.)
Line 2: Line 2:
 
[[it:Connman]]
 
[[it:Connman]]
 
[[Category:Networking]]
 
[[Category:Networking]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|Covers installation and configuration of ConnMan – an alternative to [[NetworkManager]].}}
+
{{Related|Network Configuration}}
{{Article summary heading|Related}}
+
{{Related|Wireless Setup}}
{{Article summary wiki|Network Configuration}}
+
{{Related articles end}}
{{Article summary wiki|Wireless Setup}}
+
{{Article summary end}}
+
 
{{Expansion|Only WiFi plugin is described in [[#Usage]] section.}}
 
{{Expansion|Only WiFi plugin is described in [[#Usage]] section.}}
 
[http://connman.net/ ConnMan] is an alternative to [[NetworkManager]] and [[Wicd]] and was created by Intel and the Moblin project for use with embedded devices. ConnMan is designed to be light on resources making it ideal for netbooks, and other mobile devices. It is modular in design takes advandage of the dbus API and provides proper abstraction on top of wpa_supplicant. ConnMan currently has plugins available for:
 
[http://connman.net/ ConnMan] is an alternative to [[NetworkManager]] and [[Wicd]] and was created by Intel and the Moblin project for use with embedded devices. ConnMan is designed to be light on resources making it ideal for netbooks, and other mobile devices. It is modular in design takes advandage of the dbus API and provides proper abstraction on top of wpa_supplicant. ConnMan currently has plugins available for:
Line 47: Line 45:
  
 
=== Using the command line client ===
 
=== Using the command line client ===
 +
 
As of version 1.7 connman has a standard command line client {{ic|connmanctl}}.   
 
As of version 1.7 connman has a standard command line client {{ic|connmanctl}}.   
  
====Connecting to an open access point====
+
==== Connecting to an open access point ====
 +
 
 
The commands in this section show how to run connmanctl in command mode.  It is also possible to run connmanctl
 
The commands in this section show how to run connmanctl in command mode.  It is also possible to run connmanctl
 
in interactive mode.  An example of how to use connmanctl in interactive mode can be found in the next section.
 
in interactive mode.  An example of how to use connmanctl in interactive mode can be found in the next section.
Line 60: Line 60:
 
{{Note|You will see something similar to this ('''not''' actual results):}}
 
{{Note|You will see something similar to this ('''not''' actual results):}}
  
$ connmanctl services
+
{{hc|$ connmanctl services|
*AO MyNetwork              wifi_dc85de828967_68756773616d_managed_psk
+
*AO MyNetwork              wifi_dc85de828967_68756773616d_managed_psk
    OtherNET                wifi_dc85de828967_38303944616e69656c73_managed_psk  
+
    OtherNET                wifi_dc85de828967_38303944616e69656c73_managed_psk  
    AnotherOne              wifi_dc85de828967_3257495245363836_managed_wep
+
    AnotherOne              wifi_dc85de828967_3257495245363836_managed_wep
    FourthNetwork          wifi_dc85de828967_4d7572706879_managed_wep
+
    FourthNetwork          wifi_dc85de828967_4d7572706879_managed_wep
    AnOpenNetwork          wifi_dc85de828967_4d6568657272696e_managed_none
+
    AnOpenNetwork          wifi_dc85de828967_4d6568657272696e_managed_none
 +
}}
  
 
To connect to an open network simple use the enter the second field beginning with '''wifi_''':  
 
To connect to an open network simple use the enter the second field beginning with '''wifi_''':  
Line 72: Line 73:
 
You should now be connected to the network. Check using {{ic|ip a}} or {{ic|connmanctl state}}.
 
You should now be connected to the network. Check using {{ic|ip a}} or {{ic|connmanctl state}}.
  
====Connecting to a protected access point====
+
==== Connecting to a protected access point ====
 +
 
 
To connect to a protected access point connmanctl needs to be run in interactive mode.  For protected access points
 
To connect to a protected access point connmanctl needs to be run in interactive mode.  For protected access points
 
you will need to provide some information to the connman daemon, at the very least a password or a passphrase.  In interactive mode we can  
 
you will need to provide some information to the connman daemon, at the very least a password or a passphrase.  In interactive mode we can  
Line 139: Line 141:
 
== See also ==
 
== See also ==
  
For further detailed information on '''ConnMan''' refer to this documentation:  
+
For further detailed information on ConnMan refer to this documentation:  
 
http://git.kernel.org/cgit/network/connman/connman.git/plain/doc/overview-api.txt?id=HEAD
 
http://git.kernel.org/cgit/network/connman/connman.git/plain/doc/overview-api.txt?id=HEAD

Revision as of 13:37, 13 January 2014

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Only WiFi plugin is described in #Usage section. (Discuss in Talk:Connman#)

ConnMan is an alternative to NetworkManager and Wicd and was created by Intel and the Moblin project for use with embedded devices. ConnMan is designed to be light on resources making it ideal for netbooks, and other mobile devices. It is modular in design takes advandage of the dbus API and provides proper abstraction on top of wpa_supplicant. ConnMan currently has plugins available for:

  • WiFi
  • Ethernet
  • Bluetooth (Through bluez)
  • WiMAX
  • VPN's (Through the connman-vpn.service)

It is typically used for wireless networking and being plugin based it is extremely fast at resolving connections. After setup you may wish to check for yourself with systemd-analyze blame to see the difference in performance compared to other network managers.

Installation

Install connman from the official repositories.

Configuring

To control ConnMan as a regular user, add these lines to /etc/dbus-1/system.d/connman.conf under the policy user="root" block.

Note: This is now implemented in the current releases of ConnMan
  <policy group="network">
       <allow send_destination="org.moblin.connman"/>
       <allow send_interface="org.moblin.connman.Agent"/>
       <allow send_interface="org.moblin.connman.Counter"/>
   </policy>

Usage

First enable and start the connman daemon service.

Desktop clients

ConnMan only has two working panel applets and a dmenu client:

  • EConnman — Enlightenment desktop panel applet.
http://www.enlightenment.org || econnmanAUR
  • ConnMan-UI — GTK+ 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

Currently the GTK client is not 100% stable however it is good enough for day-to-day usage. To use it just add connman-ui-gtk to one of your startup files, e.g: autostart for Openbox.

Using the command line client

As of version 1.7 connman has a standard command line client connmanctl.

Connecting to an open access point

The commands in this section show how to run connmanctl in command mode. It is also possible to run connmanctl in interactive mode. An example of how to use connmanctl in interactive mode can be found in the next section.

To scan the network connmanctl accepts simple names called technologies. To scan for nearby WiFi networks:

$ connmanctl scan wifi

To list the available networks found after a scan run:

Note: You will see something similar to this (not actual results):
$ 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 simple use the enter the second field beginning with wifi_:

$ connmanctl connect wifi_dc85de828967_4d6568657272696e_managed_none

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

Connecting to a protected access point

To connect to a protected access point connmanctl needs to be run in interactive mode. For protected access points you will need to provide some information to the connman daemon, at the very least a password or a passphrase. In interactive mode we can register an agent to handle these user requests. To start simply type:

$ connmanctl

The prompt will change to "connmanctl>" to indicate you are now in interactive mode. You then proceed almost as above, first scan for any wifi technologies:

connmanctl> scan wifi

To list services:

connmanctl> services

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

connmanctl> agent on

You now need to connect to one of the protected services. To do this is is very handy to have a terminal that allows cut and paste. 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 feilds 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 do:

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

Hardware

Various hardware interfaces are referred to as Technologies by connmanctl. 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

Example:

This will toggle wifi off
$ connmanctl disable wifi 
Note: The field Type = tech_name provides the technology type used with connmanctl commands

To list available technologies run:

$ connmanctl technologies

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

$ connmanctl technologies | grep "Type" | awk '{print $NF}'

See also

For further detailed information on ConnMan refer to this documentation: http://git.kernel.org/cgit/network/connman/connman.git/plain/doc/overview-api.txt?id=HEAD