• No results found

Network Manager Command Line Tool 11.3

In document SX-6K3-EVK-SD User Guide (Page 41-45)

Included with Ubuntu is a tool that allows interaction with the network manager using the command line. The following section will show some common examples and provide a full overview of the tools capabilities. The tool is called nmcli and is usable from any console interface (serial based or GUI based).

11.3.1 Checking Status of the WLAN Interface

To establish the status of the network interfaces the following command can be used:

nmcli –p nm status

(The –p is optional, it provide s a pretty output rather than a normal basic output.)

To establish the current connection status of the WLAN interface the following command can be

Silex Technology America, Inc. CONFIDENTIAL To get more information regarding the connection, once one is established using the WLAN interface use the following command:

nmcli –p con status

To list available AP’s use the following command:

nmcli –p dev wifi list

Turning on the WLAN interface:

nmcli nm wifi on

Turning off thre WLAN interface:

nmcli nm wifi off

The full set of nmcli commands are identified in the table below.

The nmcli command has the following format:

nwmcli [OPTIONS] OBJECT {COMMAND | help}

Table 2 - nmcli Options Table

Option Description

-t, --terse Output is terse. This mode is designed and suitable for computer (script) processing.

-p, --pretty Output is pretty. This causes nmcli to produce easy readable outputs for humans, i.e. values are aligned, headers are printed, etc.

-m, --mode tabular|multiline

Switch between tabular and multiline output. If omitted, default is tabular for most commands. For the commands producing more structured information that cannot be displayed on a single line default is multiline.

tabular - Output is a table where each line describes a single entry. Columns define particular properties of the entry.

multiline - Each entry comprises more lines, each property on its own line. The values are prefixed with the property name.

-f, --fields <field1,..>|all|common

This option is used to specify what fields (column names) should be printed. Valid field names differ for specific commands. List available fields by providing an invalid value to the --fields option.

all is used to print all valid field values of the command. common is used to print common field values of the command. If omitted, default is common. The option is mandatory when --terse is used. In this case, generic values all and common cannot be used.

-e, --escape yes|no Whether to escape ':' and '\' characters in terse tabular mode. The escape character is '\'. If omitted, default is yes.

-v, --version Show nmcli version.

-h, --help Print help information.

Table 3 - nmcli Object & Command Options

Object Command Option 1 Option 2 Comment

nm status Show overall status of NetworkManager. This is the default action, when no command is provided to nm object.

sleep Put NetworkManager into sleep mode. When placed in this mode all interfaces that NetworkManager manages are deactivated.

wakeup Awake NetworkManager from sleep. When NetworkManager is awakened, devices are available to be activated.

wifi Inquire or set status of WiFi interface in NetworkManager.

on Enables WiFi Interface

off Disables WIFi Interface

wwan Inquire or set status of WWAN interface in NetworkManager.

on Enables WWAN interface

off Disables WWAN interface

con list List configured connections. Without a parameter, configured connection from both system and user settings services are listed.

id <id>

uuid <id>

system argument filters only system-wide

connections

user prints user connections only

status Print status of active connections.

up Activate a connection. Following options allow specific interfaces and behaviors to be defined.

id <id> iface <iface>

ap <hwaddr> Specifies the AP to be connected to.

--nowait Causes nmcli to exit immediately and not to wait for command completion.

--timeout <sec> Provides a means to specify how long to wait for operation completion.

uuid <id> iface <iface>

ap <hwaddr> Specifies the AP to be connected to.

--nowait Causes nmcli to exit immediately and not to wait for command completion.

--timeout <sec> Provides a means to specify how long to wait for operation completion.

down Deactivate a connection. The connection is identified by its name using id or UUID using uuid.

id <id>

uuid <id>

dev status Print status of devices. This is the default action, when no command is specified to dev object.

list Get detailed information about devices. Without an argument, all devices are examined.

iface <iface> Gets information for a specific device.

disconnect Disconnect a device and prevent the device from automatically activating further connections without user/manual intervention.

iface <iface> --nowait Causes nmcli to exit immediately and not to wait for command completion.

--timeout <sec> Provides a means to specify how long to wait for operation completion.

wifi List available WiFi access points.

list iface <iface> List’s AP’s seen by specific interface hwaddr <hwaddr> List’s only specified AP’s if seen in scan

results.

Silex Technology America, Inc. CONFIDENTIAL

12 Revision History

Rev No. Date By Comments

A 10/1/2013 ACR Initial Release

Silex Technology America, Inc.

www.silexamerica.com

In document SX-6K3-EVK-SD User Guide (Page 41-45)

Related documents