From 288a08a3672a89a9bfdb8354b6863cc039759fc2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 12 Apr 2016 17:33:05 +0200 Subject: Imported Upstream version 1.1.94 --- docs/api/html/nmcli-examples.html | 119 +++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 60 deletions(-) (limited to 'docs/api/html/nmcli-examples.html') diff --git a/docs/api/html/nmcli-examples.html b/docs/api/html/nmcli-examples.html index e903cd68..3e9d0b52 100644 --- a/docs/api/html/nmcli-examples.html +++ b/docs/api/html/nmcli-examples.html @@ -2,12 +2,12 @@ -nmcli-examples: NetworkManager D-Bus API Reference Manual +nmcli-examples: NetworkManager Reference Manual - - - - + + + + @@ -16,8 +16,8 @@ Home Up -Prev -Next +Prev +Next
@@ -30,10 +30,10 @@

Synopsis

-

nmcli [OPTIONS...]

+

nmcli [OPTIONS...]

-

Description

+

Description

nmcli is a command-line client for NetworkManager. It allows controlling NetworkManager and reporting its status. For more information @@ -44,14 +44,13 @@ The purpose of this manual page is to provide you with various examples and usage scenarios of nmcli.

-

Note: this page has "work-in-progress" status.

-

Examples

+

Examples

-

Example 1. Listing available Wi-Fi APs

+

Example 1. Listing available Wi-Fi APs

-
$ nmcli device wifi list
+
$ nmcli device wifi list
 *  SSID               MODE    CHAN  RATE       SIGNAL  BARS  SECURITY
    netdatacomm_local  Infra   6     54 Mbit/s  37      ▂▄__  WEP
 *  F1                 Infra   11    54 Mbit/s  98      ▂▄▆█  WPA1
@@ -72,9 +71,9 @@
 

-

Example 2. Showing general information and properties for a Wi-Fi interface

+

Example 2. Showing general information and properties for a Wi-Fi interface

-
$ nmcli -p -f general,wifi-properties device show wlan0
+
$ nmcli -p -f general,wifi-properties device show wlan0
 ===========================================================================
                         Device details (wlan0)
 ===========================================================================
@@ -114,9 +113,9 @@ WIFI-PROPERTIES.ADHOC:    yes
 

-

Example 3. Listing NetworkManager polkit permissions

+

Example 3. Listing NetworkManager polkit permissions

-
$ nmcli general permissions
+
$ nmcli general permissions
 PERMISSION                                                VALUE
 org.freedesktop.NetworkManager.enable-disable-network     yes
 org.freedesktop.NetworkManager.enable-disable-wifi        yes
@@ -145,9 +144,9 @@ org.freedesktop.NetworkManager.settings.modify.hostname   auth

-

Example 4. Listing NetworkManager log level and domains

+

Example 4. Listing NetworkManager log level and domains

-
$ nmcli general logging
+
$ nmcli general logging
 LEVEL  DOMAINS
 INFO   PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,A
 UTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,
@@ -159,10 +158,10 @@ B,DISPATCH

-

Example 5. Changing NetworkManager logging

+

Example 5. Changing NetworkManager logging

-
$ nmcli g log level DEBUG domains CORE,ETHER,IP
-$ nmcli g log level INFO domains DEFAULT
+
$ nmcli g log level DEBUG domains CORE,ETHER,IP
+$ nmcli g log level INFO domains DEFAULT

The first command makes NetworkManager log in DEBUG level, and only for CORE, ETHER and IP domains. The second command restores the default logging state. Please refer to the @@ -172,11 +171,11 @@ B,DISPATCH


-

Example 6. Adding a bonding master and two slave connection profiles

+

Example 6. Adding a bonding master and two slave connection profiles

-
$ nmcli con add type bond ifname mybond0 mode active-backup
-$ nmcli con add type ethernet ifname eth1 master mybond0
-$ nmcli con add type ethernet ifname eth2 master mybond0
+
$ nmcli con add type bond ifname mybond0 mode active-backup
+$ nmcli con add type ethernet ifname eth1 master mybond0
+$ nmcli con add type ethernet ifname eth2 master mybond0

This example demonstrates adding a bond master connection and two slaves. The first command adds a master bond connection, naming the bonding interface @@ -188,11 +187,11 @@ B,DISPATCH


-

Example 7. Adding a team master and two slave connection profiles

+

Example 7. Adding a team master and two slave connection profiles

-
$ nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf
-$ nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1
-$ nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1
+
$ nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf
+$ nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1
+$ nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1

This example demonstrates adding a team master connection profile and two slaves. It is very similar to the bonding example. The first command adds a master team profile, naming @@ -206,8 +205,8 @@ B,DISPATCH teamd will use its default configuration. You will activate the whole setup by activating both slaves:

-
  $ nmcli con up Team1-slave1
-  $ nmcli con up Team1-slave2
+
  $ nmcli con up Team1-slave1
+  $ nmcli con up Team1-slave2

By default, the created profiles are marked for auto-activation. But if another connection has been activated on the device, the new profile won't activate @@ -216,12 +215,12 @@ B,DISPATCH


-

Example 8. Adding a bridge and two slave profiles

+

Example 8. Adding a bridge and two slave profiles

-
$ nmcli con add type bridge con-name TowerBridge ifname TowerBridge
-$ nmcli con add type ethernet con-name br-slave-1 ifname ens3 master TowerBridge
-$ nmcli con add type ethernet con-name br-slave-2 ifname ens4 master TowerBridge
-$ nmcli con modify TowerBridge bridge.stp no
+
$ nmcli con add type bridge con-name TowerBridge ifname TowerBridge
+$ nmcli con add type ethernet con-name br-slave-1 ifname ens3 master TowerBridge
+$ nmcli con add type ethernet con-name br-slave-2 ifname ens4 master TowerBridge
+$ nmcli con modify TowerBridge bridge.stp no

This example demonstrates adding a bridge master connection and two slaves. The first command adds a master bridge connection, naming the bridge interface and @@ -235,14 +234,14 @@ B,DISPATCH


-

Example 9. Adding an ethernet connection profile with manual IP configuration

+

Example 9. Adding an ethernet connection profile with manual IP configuration

-
$ nmcli con add con-name my-con-em1 ifname em1 type ethernet \
+
$ nmcli con add con-name my-con-em1 ifname em1 type ethernet \
   ip4 192.168.100.100/24 gw4 192.168.100.1 ip4 1.2.3.4 ip6 abbe::cafe
-$ nmcli con mod my-con-em1 ipv4.dns "8.8.8.8 8.8.4.4"
-$ nmcli con mod my-con-em1 +ipv4.dns 1.2.3.4
-$ nmcli con mod my-con-em1 ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"
-$ nmcli -p con show my-con-em1
+$ nmcli con mod my-con-em1 ipv4.dns "8.8.8.8 8.8.4.4" +$ nmcli con mod my-con-em1 +ipv4.dns 1.2.3.4 +$ nmcli con mod my-con-em1 ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844" +$ nmcli -p con show my-con-em1

The first command adds an Ethernet connection profile named my-con-em1 that is bound to interface name em1. The profile is configured @@ -258,9 +257,9 @@ B,DISPATCH


-

Example 10. Escaping colon characters in tabular mode

+

Example 10. Escaping colon characters in tabular mode

-
$ nmcli -t -f general -e yes -m tab dev show eth0
+
$ nmcli -t -f general -e yes -m tab dev show eth0
 GENERAL:eth0:ethernet:Intel Corporation:82567LM Gigabit Network Connection:
 e1000e:2.1.4-k:1.8-3:00\:22\:68\:15\:29\:21:1500:100 (connected):0 (No reas
 on given):/sys/devices/pci0000\:00/0000\:00\:19.0/net/eth0:eth0:yes:yes:no:
@@ -273,7 +272,7 @@ nager/ActiveConnection/9

-

Example 11. nmcli usage in a NetworkManager dispatcher script to make Ethernet and Wi-Fi mutually exclusive

+

Example 11. nmcli usage in a NetworkManager dispatcher script to make Ethernet and Wi-Fi mutually exclusive

 #!/bin/bash
@@ -311,9 +310,9 @@ fi
 

Example sessions of interactive connection editor

-

Example 12. Adding an ethernet connection profile in interactive editor (a)

+

Example 12. Adding an ethernet connection profile in interactive editor (a)

-
$ nmcli connection edit type ethernet
+
$ nmcli connection edit type ethernet
 
 ===| nmcli interactive connection editor |===
 
@@ -324,7 +323,7 @@ Type 'describe [<setting>.<prop>]' for detailed property description
 
 You may edit the following settings: connection, 802-3-ethernet (ethernet),
 802-1x, ipv4, ipv6, dcb
-nmcli> print
+nmcli> print
 ===========================================================================
                           Connection details
 ===========================================================================
@@ -384,13 +383,13 @@ ipv6.may-fail:                      yes
 ipv6.ip6-privacy:                   -1 (unknown)
 ipv6.dhcp-hostname:                 --
 ---------------------------------------------------------------------------
-nmcli> goto ethernet
+nmcli> goto ethernet
 You may edit the following properties: port, speed, duplex, auto-negotiate,
  mac-address, cloned-mac-address, mac-address-blacklist, mtu, s390-subchann
 els, s390-nettype, s390-options
 nmcli 802-3-ethernet> set mtu 1492
 nmcli 802-3-ethernet> b
-nmcli> goto ipv4.addresses
+nmcli> goto ipv4.addresses
 nmcli ipv4.addresses> desc
 
 === [addresses] ===
@@ -411,10 +410,10 @@ nmcli ipv4.addresses> print
 addresses: 192.168.1.100/24
 nmcli ipv4.addresses> back
 nmcli ipv4> b
-nmcli> set ipv4.gateway 192.168.1.1
-nmcli> verify
+nmcli> set ipv4.gateway 192.168.1.1
+nmcli> verify
 Verify connection: OK
-nmcli> print
+nmcli> print
 ===========================================================================
                           Connection details
 ===========================================================================
@@ -473,8 +472,8 @@ ipv6.may-fail:                      yes
 ipv6.ip6-privacy:                   -1 (unknown)
 ipv6.dhcp-hostname:                 --
 ---------------------------------------------------------------------------
-nmcli> set ipv4.dns 8.8.8.8 8.8.4.4
-nmcli> print
+nmcli> set ipv4.dns 8.8.8.8 8.8.4.4
+nmcli> print
 ===========================================================================
                           Connection details
 ===========================================================================
@@ -534,12 +533,12 @@ ipv6.may-fail:                      yes
 ipv6.ip6-privacy:                   -1 (unknown)
 ipv6.dhcp-hostname:                 --
 ---------------------------------------------------------------------------
-nmcli> verify
+nmcli> verify
 Verify connection: OK
-nmcli> save
+nmcli> save
 Connection 'ethernet-4' (de89cdeb-a3e1-4d53-8fa0-c22546c775f4) successfully
  saved.
-nmcli> quit
+nmcli> quit

Example session in the nmcli interactive connection editor. The scenario creates an Ethernet connection profile with static addressing (IPs and DNS). @@ -549,7 +548,7 @@ nmcli> quit

-

See Also

+

See Also

nmcli(1), NetworkManager(8), -- cgit 1.3.0-6-gf8a5