nmcli-examples

package: NetworkManager-daemon

title: nmcli-examples(7)

summary: usage examples of nmcli

text:
# nmcli-examples(7)

## NAME
nmcli-examples - usage examples of nmcli

## SYNOPSIS
nmcli [OPTIONS...]

## DESCRIPTION
nmcli is a command-line client for NetworkManager. It allows controlling NetworkManager and reporting its status. For more information please refer to nmcli(1) manual page.

The purpose of this manual page is to provide you with various examples and usage scenarios of nmcli.

## EXAMPLES
Example 1. Listing available Wi-Fi APs

```
$ 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

   LoremCorp          Infra   1     54 Mbit/s  62      ▂▄▆_  WPA2 802.1X

   Internet           Infra   6     54 Mbit/s  29      ▂___  WPA1

   HPB110a.F2672A     Ad-Hoc  6     54 Mbit/s  22      ▂___  --

   Jozinet            Infra   1     54 Mbit/s  19      ▂___  WEP

   VOIP               Infra   1     54 Mbit/s  20      ▂___  WEP

   MARTINA            Infra   4     54 Mbit/s  32      ▂▄__  WPA2

   N24PU1             Infra   7     11 Mbit/s  22      ▂___  --

   alfa               Infra   1     54 Mbit/s  67      ▂▄▆_  WPA2

   bertnet            Infra   5     54 Mbit/s  20      ▂___  WPA1 WPA2
```

This command shows how to list available Wi-Fi networks (APs). You can also use --fields option for displaying different columns. nmcli -f all dev wifi list will show all of them.

Example 2. Connect to a password-protected wifi network

```
$ nmcli device wifi connect "$SSID" password "$PASSWORD"
```

```
$ nmcli --ask device wifi connect "$SSID"
```

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

```
$ nmcli -p -f general,wifi-properties device show wlan0
===========================================================================

                        Device details (wlan0)
===========================================================================
GENERAL.DEVICE:           wlan0
GENERAL.TYPE:             wifi
GENERAL.VENDOR:           Intel Corporation
GENERAL.PRODUCT:          PRO/Wireless 5100 AGN [Shiloh] Network Connection
GENERAL.DRIVER:           iwlwifi
GENERAL.DRIVER-VERSION:   3.8.13-100.fc17.x86_64
GENERAL.FIRMWARE-VERSION: 8.83.5.1 build 33692
GENERAL.HWADDR:           00:1E:65:37:A1:D3
GENERAL.MTU:              1500
GENERAL.STATE:            100 (connected)
GENERAL.REASON:           0 (No reason given)
GENERAL.UDI:              /sys/devices/pci0000:00/0000:00:1c.1/net/wlan0
GENERAL.IP-IFACE:         wlan0
GENERAL.IS-SOFTWARE:      no
GENERAL.NM-MANAGED:       yes
GENERAL.AUTOCONNECT:      yes
GENERAL.FIRMWARE-MISSING: no
GENERAL.CONNECTION:       My Alfa WiFi
GENERAL.CON-UUID:         85194f4c-d496-4eec-bae0-d880b4cbcf26
GENERAL.CON-PATH:         /org/freedesktop/NetworkManager/ActiveConnection/
10
---------------------------------------------------------------------------
WIFI-PROPERTIES.WEP:      yes
WIFI-PROPERTIES.WPA:      yes
WIFI-PROPERTIES.WPA2:     yes
WIFI-PROPERTIES.TKIP:     yes
WIFI-PROPERTIES.CCMP:     yes
WIFI-PROPERTIES.AP:       no
WIFI-PROPERTIES.ADHOC:    yes
---------------------------------------------------------------------------
```

This command shows information about a Wi-Fi device.

Example 4. Listing NetworkManager polkit permissions

```
$ nmcli general permissions
PERMISSION                                                VALUE
org.freedesktop.NetworkManager.enable-disable-network     yes
org.freedesktop.NetworkManager.enable-disable-wifi        yes
org.freedesktop.NetworkManager.enable-disable-wwan        yes
org.freedesktop.NetworkManager.enable-disable-wimax       yes
org.freedesktop.NetworkManager.sleep-wake                 no
org.freedesktop.NetworkManager.network-control            yes
org.freedesktop.NetworkManager.wifi.share.protected       yes
org.freedesktop.NetworkManager.wifi.share.open            yes
org.freedesktop.NetworkManager.settings.modify.system     yes
org.freedesktop.NetworkManager.settings.modify.own        yes
org.freedesktop.NetworkManager.settings.modify.hostname   auth
org.freedesktop.NetworkManager.settings.modify.global-dns auth
org.freedesktop.NetworkManager.reload                     auth
```

This command shows configured polkit permissions for various NetworkManager operations. These permissions or actions (using polkit language) are configured by a system administrator and are not meant to be changed by users. The usual place for the polkit configuration is /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy. pkaction command can display description for polkit actions.

```
  pkaction --action-id org.freedesktop.NetworkManager.network-control --verbose

```

More information about polkit can be found at http://www.freedesktop.org/wiki/Software/polkit.

Example 5. Listing NetworkManager log level and domains

```
$ 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,
WIMAX,INFINIBAND,FIREWALL,ADSL,BOND,VLAN,BRIDGE,DBUS_PROPS,TEAM,CONCHECK,DC
B,DISPATCH
```

This command shows current NetworkManager logging status.

Example 6. Changing NetworkManager logging

```
$ 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 NetworkManager.conf(5) manual page for available logging levels and domains.

Example 7. Activating a VPN connection profile requiring interactive password input

```
$ nmcli --ask con up my-vpn-con
```

This command activates a VPN connection profile enabling nmcli to interact with the user ('--ask'): this will allow nmcli to prompt for the VPN password on the command line when the password-flags are set to '0x02' ('always ask', see nm-settings-nmcli(5) ). This is particularly useful for OTP based VPNs, as the user needs to be prompted for the password each time the connection is activated.

Example 8. Adding a bonding controller and two port connection profiles

```
$ nmcli con add type bond ifname mybond0 mode active-backup
$ nmcli con add type ethernet ifname eth1 controller mybond0
$ nmcli con add type ethernet ifname eth2 controller mybond0
```

This example demonstrates adding a bond controller connection and two ports. The first command adds a controller bond connection, naming the bonding interface mybond0 and using active-backup mode. The next two commands add port connections, both attached as port to mybond0. The first port will be bound to eth1 interface, the second to eth2.

Example 9. Adding a team controller and two port connection profiles

```
$ nmcli con add type team con-name Team1 ifname Team1 config team1-controller-json.conf
$ nmcli con add type ethernet con-name Team1-port1 ifname em1 controller Team1
$ nmcli con add type ethernet con-name Team1-port2 ifname em2 controller Team1
```

This example demonstrates adding a team controller connection profile and two ports. It is very similar to the bonding example. The first command adds a controller team profile, naming the team interface and the profile Team1. The team configuration for the controller is read from team1-controller-json.conf file. Later, you can change the configuration with modify command (nmcli con modify Team1 team.config team1-controller-another-json.conf). The last two commands add port profiles, both attached as port to Team1. The first port will be bound to the em1 interface, the second to em2. The ports don't specify config and thus teamd will use its default configuration. You will activate the whole setup by activating both ports:

```
  $ nmcli con up Team1-port1

  $ nmcli con up Team1-port2
```

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 automatically and you need to activate it manually.

Example 10. Adding a bridge and two port profiles

```
$ nmcli con add type bridge con-name TowerBridge ifname TowerBridge
$ nmcli con add type ethernet con-name br-port-1 ifname ens3 controller TowerBridge
$ nmcli con add type ethernet con-name br-port-2 ifname ens4 controller TowerBridge
$ nmcli con modify TowerBridge bridge.stp no
```

This example demonstrates adding a bridge controller connection and two ports. The first command adds a controller bridge connection, naming the bridge interface and the profile as TowerBridge. The next two commands add ports profiles, both will be attached as port to TowerBridge. The first port will be tied to ens3 interface, the second to ens4. The last command will disable 802.1D STP for the TowerBridge profile.

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

```
$ 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
```

The first command adds an Ethernet connection profile named my-con-em1 that is bound to interface name em1. The profile is configured with static IP addresses. Three addresses are added, two IPv4 addresses and one IPv6. The first IP 192.168.100.100 has a prefix of 24 (netmask equivalent of 255.255.255.0). Gateway entry will become the default route if this profile is activated on em1 interface (and there is no connection with higher priority). The next two addresses do not specify a prefix, so a default prefix will be used, i.e. 32 for IPv4 and 128 for IPv6. The second, third and fourth commands modify DNS parameters of the new connection profile. The last con show command displays the profile so that all parameters can be reviewed.

Example 12. Convenient field values retrieval for scripting

```
$ nmcli -g ip4.address connection show my-con-eth0
192.168.1.12/24
```

```
$ nmcli -g ip4.address,ip4.dns connection show my-con-eth0
192.168.1.12/24
192.168.1.1
```

```
$ nmcli -g ip4 connection show my-con-eth0
IP4:192.168.1.12/24:192.168.1.1::192.168.1.1::
```

This example shows retrieval of ip4 connection field values via the --get-values option. Multiple comma separated fields can be provided: they will be printed one per line. If a whole section is provided instead of a single field, the name of the section will be printed followed by all the related field values on the same line. See also --terse, --mode, --fields and --escape options in nmcli(1) manual page for more customized output.

Example 13. Adding an Ethernet connection and configuring SR-IOV VFs

```
$ nmcli con add type ethernet con-name EthernetPF ifname em1
$ nmcli con modify EthernetPF sriov.total-vfs 3 sriov.autoprobe-drivers false
$ nmcli con modify EthernetPF sriov.vfs '0 mac=00:11:22:33:44:55 vlans=10, 1 trust=true spoof-check=false'
$ nmcli con modify EthernetPF +sriov.vfs '2 max-tx-rate=20'
```

This example demonstrates adding an Ethernet connection for physical function (PF) ens4 and configuring 3 SR-IOV virtual functions (VFs) on it. The first VF is configured with MAC address 00:11:22:33:44:55 and VLAN 10, the second one has the trust and spoof-check features respectively enabled and disabled. VF number 2 has a maximum transmission rate of 20Mbps. The kernel is instructed to not automatically instantiate a network interface for the VFs.

Example 14. Escaping colon characters in tabular mode

```
$ 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:
ethernet-13:89cbcbc6-dc85-456c-9c8b-bd828fee3917:/org/freedesktop/NetworkMa
nager/ActiveConnection/9
```

This example shows escaping colon characters in tabular mode. It may be useful for script processing, because ':' is used as a field separator.

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

```
#!/bin/bash
export LC_ALL=C
enable_disable_wifi ()
{

    result=$(nmcli dev | grep "ethernet" | grep -w "connected")

    if [ -n "$result" ]; then

        nmcli radio wifi off

    else

        nmcli radio wifi on

    fi
}
if [ "$2" = "up" ]; then

    enable_disable_wifi
fi
if [ "$2" = "down" ]; then

    enable_disable_wifi
fi

```

This dispatcher script makes Wi-Fi mutually exclusive with wired networking. When a wired interface is connected, Wi-Fi will be set to airplane mode (rfkilled). When the wired interface is disconnected, Wi-Fi will be turned back on. Name this script e.g. 70-wifi-wired-exclusive.sh and put it into /etc/NetworkManager/dispatcher.d/ directory. See NetworkManager(8) manual page for more information about NetworkManager dispatcher scripts.

Example sessions of interactive connection editor

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

```
$ nmcli connection edit type ethernet
===| nmcli interactive connection editor |===
Adding a new '802-3-ethernet' connection
Type 'help' or '?' for available commands.
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
===========================================================================

                          Connection details
===========================================================================
connection.id:                      ethernet-4
connection.uuid:                    de89cdeb-a3e1-4d53-8fa0-c22546c775f4
connection.interface-name:          --
connection.type:                    802-3-ethernet
connection.autoconnect:             yes
connection.autoconnect-priority:    0
connection.timestamp:               0
connection.read-only:               no
connection.permissions:
connection.zone:                    --
connection.controller:              --
connection.port-type:               --
connection.secondaries:
connection.gateway-ping-timeout:    0
---------------------------------------------------------------------------
802-3-ethernet.port:                --
802-3-ethernet.speed:               0
802-3-ethernet.duplex:              --
802-3-ethernet.auto-negotiate:      yes
802-3-ethernet.mac-address:         --
802-3-ethernet.cloned-mac-address:  --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu:                 auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype:        --
802-3-ethernet.s390-options:
---------------------------------------------------------------------------
ipv4.method:                        auto
ipv4.dns:
ipv4.dns-search:
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-send-hostname:            yes
ipv4.dhcp-hostname:                 --
ipv4.never-default:                 no
ipv4.may-fail:                      yes
---------------------------------------------------------------------------
ipv6.method:                        auto
ipv6.dns:
ipv6.dns-search:
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.dhcp-hostname:                 --
---------------------------------------------------------------------------
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 ipv4.addresses> desc
=== [addresses] ===
[NM property description]
Array of IP addresses.
[nmcli specific description]
Enter a list of IPv4 addresses formatted as:

  ip[/prefix], ip[/prefix],...
Missing prefix is regarded as prefix of 32.
Example: 192.168.1.5/24, 10.0.0.11/24
nmcli ipv4.addresses> set 192.168.1.100/24
Do you also want to set 'ipv4.method' to 'manual'? [yes]: yes
nmcli ipv4.addresses>
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
Verify connection: OK
nmcli> print
===========================================================================

                          Connection details
===========================================================================
connection.id:                      ethernet-4
connection.uuid:                    de89cdeb-a3e1-4d53-8fa0-c22546c775f4
connection.interface-name:          --
connection.type:                    802-3-ethernet
connection.autoconnect:             yes
connection.autoconnect-priority:    0
connection.timestamp:               0
connection.read-only:               no
connection.permissions:
connection.zone:                    --
connection.controller:              --
connection.port-type:               --
connection.secondaries:
connection.gateway-ping-timeout:    0
---------------------------------------------------------------------------
802-3-ethernet.port:                --
802-3-ethernet.speed:               0
802-3-ethernet.duplex:              --
802-3-ethernet.auto-negotiate:      yes
802-3-ethernet.mac-address:         --
802-3-ethernet.cloned-mac-address:  --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu:                 1492
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype:        --
802-3-ethernet.s390-options:
---------------------------------------------------------------------------
ipv4.method:                        manual
ipv4.dns:
ipv4.dns-search:
ipv4.addresses:                     192.168.1.100/24
ipv4.gateway:                       192.168.1.1
ipv4.routes:
ipv4.route-metric:                  -1
ipv4.ignore-auto-routes:            no
ipv4.ignore-auto-dns:               no
ipv4.dhcp-client-id:                --
ipv4.dhcp-send-hostname:            yes
ipv4.dhcp-hostname:                 --
ipv4.never-default:                 no
ipv4.may-fail:                      yes
---------------------------------------------------------------------------
ipv6.method:                        auto
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
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.dhcp-hostname:                 --
---------------------------------------------------------------------------
nmcli> set ipv4.dns 8.8.8.8 8.8.4.4
nmcli> print
===========================================================================

                          Connection details
===========================================================================
connection.id:                      ethernet-4
connection.uuid:                    de89cdeb-a3e1-4d53-8fa0-c22546c775f4
connection.interface-name:          --
connection.type:                    802-3-ethernet
connection.autoconnect:             yes
connection.autoconnect-priority:    0
connection.timestamp:               0
connection.read-only:               no
connection.permissions:
connection.zone:                    --
connection.controller:              --
connection.port-type:               --
connection.secondaries:
connection.gateway-ping-timeout:    0
---------------------------------------------------------------------------
802-3-ethernet.port:                --
802-3-ethernet.speed:               0
802-3-ethernet.duplex:              --
802-3-ethernet.auto-negotiate:      yes
802-3-ethernet.mac-address:         --
802-3-ethernet.cloned-mac-address:  --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu:                 1492
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype:        --
802-3-ethernet.s390-options:
---------------------------------------------------------------------------
ipv4.method:                        manual
ipv4.dns:                           8.8.8.8,8.8.4.4
ipv4.dns-search:
ipv4.addresses:                     192.168.1.100/24
ipv4.gateway:                       192.168.1.1
ipv4.routes:
ipv4.route-metric:                  -1
ipv4.ignore-auto-routes:            no
ipv4.ignore-auto-dns:               no
ipv4.dhcp-client-id:                --
ipv4.dhcp-send-hostname:            yes
ipv4.dhcp-hostname:                 --
ipv4.never-default:                 no
ipv4.may-fail:                      yes
---------------------------------------------------------------------------
ipv6.method:                        auto
ipv6.dns:
ipv6.dns-search:
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.dhcp-hostname:                 --
---------------------------------------------------------------------------
nmcli> verify
Verify connection: OK
nmcli> save
Connection 'ethernet-4' (de89cdeb-a3e1-4d53-8fa0-c22546c775f4) successfully

 saved.
nmcli> quit
```

Example session in the nmcli interactive connection editor. The scenario creates an Ethernet connection profile with static addressing (IPs and DNS).

Example 17. Bluetooth connection profiles

NetworkManger supports both connecting to NAP and DUN devices as a client. It also supports sharing the network via a NAP server.

For NAP client connections, NetworkManager automatically creates a suitable in-memory profile for paired devices if none is available. You may use that generated profile directly, but you may also modify and persist it, which will prevent to automatically re-create it. You may also create a profile from scratch. For example, the following uses DHCP and IPv6 autoconf for address configuration:

```
$ nmcli connection add type bluetooth con-name "Profile for My Bluetooth Device (NAP)" autoconnect no bluetooth.type panu bluetooth.bdaddr "$BDADDR"
```

For DUN connections, the user needs to configure modem settings and hence no profile gets created automatically. The modem settings depend on your device and you either need a "gsm" or a "csma" section. For example,

```
$ nmcli connection add type bluetooth con-name "Profile for My Bluetooth Device (DUN)" autoconnect no bluetooth.type dun bluetooth.bdaddr "$BDADDR" gsm.apn apn.com
```

Finally, you can create a bluetooth hotspot. BlueZ implements those as a bridge device, so such profiles also have a bridge section. Also, you probably want to set IP methods as "shared", so that clients get automatic IP addressing. Note that the "shared" IPv4 method requires dnsmasq to be available.

```
$ nmcli connection add type bluetooth con-name "My Bluetooth Hotspot" autoconnect no ifname btnap0 bluetooth.type nap ipv4.method shared ipv6.method shared
```

Example 18. Offline use

```
$ nmcli --offline con add type ethernet '

  conn.id eth0 \

  conn.interface-name eth0 \

  >/sysroot/etc/NetworkManager/system-connections/eth0.nmconnection
```

Creates a connection file in keyfile format without using the NetworkManager service. This allows for use of familiar nmcli syntax in situations where the service is not running, such as during system installation of image provisioning and ensures the resulting file is correctly formatted.

```
$ nmcli --offline con modify type ethernet '

  conn.id eth0-ipv6 \

  ipv4.method disabled \

  </sysroot/etc/NetworkManager/system-connections/eth0.nmconnection \

  >/sysroot/etc/NetworkManager/system-connections/eth0-ipv6.nmconnection
```

Read and write a connection file without using the NetworkManager service, modifying some properties along the way.

This allows templating of the connection profiles using familiar nmcli syntax in situations where the service is not running.

Example 19. Device Checkpoint and Restore

```
$ nmcli dev checkpoint eth0 -- nmcli dev dis eth0
Device 'eth0' successfully disconnected.
Type "Yes" to commit the changes: No
Checkpoint was removed.
```

In this example the device eth0 was disconnected with the eth0 checkpoint taken. The user didn't confirm that the change is good, so the eth0 was brought back to the state it was when the checkpoint was taken.

If the command being run unintentionaly brings down the remote connection (such as a ssh(1) session) to the very machine it's being run on, the user wouldn't be able to confirm the success and the connectivity would end up being restored after a timeout.

If, on the other hand, the command results in a success, the user could just confirm, causing the checkpoint to be abandoned without a rollback:

```
$ nmcli dev checkpoint -- ip link del br0
Type "Yes" to commit the changes: Yes
```

## SEE ALSO
nmcli(1), NetworkManager(8), NetworkManager.conf(5), nm-settings-nmcli(5), nm-online(1), nm-applet(1), nm-connection-editor(1)


nm-openvswitch

package: NetworkManager-ovs

title: nm-openvswitch(7)

text:
# nm-openvswitch(7)

## NAME
nm-openvswitch - overview of NetworkManager Open vSwitch support

## OVERVIEW
NetworkManager includes basic Open vSwitch support, good enough to be capable of setting up simple Open vSwitch configurations. It is not extensive and does not expose all functionality of Open vSwitch provides. For large or complicated deployments users are advised to use native tools shipped with Open vSwitch. This document seeks to provide overview of functionality currently provided by NetworkManager, its capabilities and limitations.

First and foremost: NetworkManager applies the configuration by modifying the OVSDB directly. Its configuration model follows the OVSDB database model closely and it does not provide the level of abstraction ovs-vsctl provides.

In practical terms it means the following:

•NetworkManager only ever talks to a single OVSDB instance via an UNIX domain socket.

•The configuration is made up of Bridges, Ports and Interfaces. Interfaces are always attached to Ports, and Ports are always attached to Bridges.

•NetworkManager only creates Bridges, Ports and Interfaces you ask it to. Unlike ovs-vsctl, it doesn't create the local interface nor its port automatically.

•You can't attach Interface directly to a Bridge. You always need a Port, even if it has just one interface.

•There are no VLANs. The VLAN tagging is enabled by setting a ovs-port.tag property on a Port.

•There are no bonds either. The bonding is enabled by enslaving multiple Interfaces to a Port and configured by setting properties on a port.

### Bridges
Bridges are represented by connections of ovs-bridge type. Due to the limitations of OVSDB, "empty" Bridges (with no Ports) can't exist. NetworkManager inserts the records for Bridges into OVSDB when a Port is attached.

Known limitation: when the last NetworkManager's owned port is removed, the bridge is removed too, even if there are other externally attached ports.

### Ports
Ports are represented by connections of ovs-port type. Due to the limitations of OVSDB, "empty" Ports (with no Interfaces) can't exist. Ports can also be configured to do VLAN tagging or Bonding. NetworkManager inserts the records for Ports into OVSDB when an Interface is attached. Ports must be attached to a Bridge.

Known limitation: when the last NetworkManager's owned interface is removed, the port is removed too, even if there are other externally attached interfaces.

### Interfaces
Interfaces are represented by a connections attached to a Port. The system interfaces (that have a corresponding Linux link) have a respective connection.type of the link (e.g. "wired", "bond", "dummy", etc.). Other interfaces ("internal" or "patch" interfaces) are of ovs-interface type. The OVSDB entries are inserted upon attachment to a Port.

## EXAMPLES
Example 1. Creating a Bridge with a single internal Interface

```
$ nmcli conn add type ovs-bridge conn.interface bridge0
Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added.
$ nmcli conn add type ovs-port conn.interface port0 controller bridge0
Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added.
$ nmcli conn add type ovs-interface port-type ovs-port conn.interface iface0 \

  controller port0 ipv4.method manual ipv4.address 192.0.2.1/24
Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added.
```

As said above, you need to create a Port even for a single interface. Also, before you add the Interface, the Bridge and Port devices appear active, but are not configured in OVSDB yet. You can inspect the results with ovs-vsctl show.

Example 2. Adding a Linux interface to a Bridge

```
$ nmcli conn add type ovs-port conn.interface port1 controller bridge0
Connection 'ovs-port-port1' (67d041eb-8e7b-4458-afee-a1d07c9c4552) successfully added.
$ nmcli conn add type ethernet conn.interface eth0 controller port1
Connection 'ovs-slave-eth0' (d459c45c-cf78-4c1c-b4b7-505e71379624) successfully added.
```

Again, you need a port.

Example 3. Creating a VLAN

```
$ nmcli conn add type ovs-port conn.interface port2 controller bridge0 ovs-port.tag 120
Connection 'ovs-port-port2' (3994c093-4ef7-4549-a4fd-627b831c3cb8) successfully added.
$ nmcli conn add type ethernet conn.interface eth1 controller port2
Connection 'ovs-slave-eth1' (099be06e-71ad-484d-8d5a-fcadc5f207f5) successfully added.
```

It's just a port with a tag.

Example 4. Creating a Bond

```
$ nmcli conn add type ovs-port conn.interface bond0 controller bridge0
Connection 'ovs-port-bond0' (d154ebf9-e999-4e1b-a084-a3de53d25d8a) successfully added.
$ nmcli conn add type ethernet conn.interface eth2 controller bond0
Connection 'ovs-slave-eth2' (475ac1bf-30b2-4534-a877-27f33f58b082) successfully added.
$ nmcli conn add type ethernet conn.interface eth3 controller bond0
Connection 'ovs-slave-eth3' (8dedeecb-ed12-482b-b77a-24a4fb835136) successfully added.
```

It's just a Port with multiple interfaces. See nm-settings-nmcli manual for Bonding options you can use with "nmcli c add" or "nmcli c modify". You could even set a VLAN tag on the same Port to do VLAN tagging and bonding at the same time.

## BUGS
•Not all Open vSwitch capabilities are supported.

•Open vSwitch devices don't expose many useful properties on D-Bus.

Probably many more.

## SEE ALSO
RFC 7047: The Open vSwitch Database Management Protocol[1], ovs-vsctl(8), ovs-vswitchd.conf.db(5), nm-settings-nmcli(5), nmcli(1)

## NOTES
1.

RFC 7047: The Open vSwitch Database Management Protocol

https://www.rfc-editor.org/rfc/rfc7047.txt


rc

package: RTags

title: rc(7)

summary: manual page for rc 2.41.133

text:
# rc(7)

## NAME
rc - manual page for rc 2.41.133

## SYNOPSIS
rc [OPTION]...

## DESCRIPTION
rc is the RTags client application.

## OPTIONS
--verbose|-v

Be more verbose.

--version

Print current version.

--verify-version|-t [arg]

Verify that the correct protocol version is used.

--silent|-Q

Be silent.

--help|-h

Display this help.

--config [arg]

Use this file (instead of ~/.rcrc).

--no-rc

Don't load any rc files.

### Rdm:
--quit-rdm|-q

Tell server to shut down with optional exit code as argument.

--connect-timeout [arg]

Timeout for connecting to rdm in ms (default 1000).

### Project management:
--clear|-C

Clear projects.

--project|-w [optional]

With arg, select project matching that if unique, otherwise list all projects.

--delete-project|-W [arg]

Delete all projects matching regex.

--job-count|-j [optional]

Set or query current job count. (Prefix with l to set low-priority-job-count).

### Indexing commands:
--compile|-c [optional]

Pass compilation arguments to rdm.

--guess-flags

Guess compile flags (used with -c).

--load-compile-commands|-J [optional]

Load compile_commands.json from directory

--suspend|-X [optional]

Dump suspended files (don't track changes in these files) with no arg. Otherwise toggle suspension for arg.

### Query commands:
--follow-location|-f [arg]

Follow this location.

--references-name|-R [arg]

Find references matching arg.

--references|-r [arg]

Find references matching this location.

--list-symbols|-S [optional]

List symbol names matching arg.

--find-symbols|-F [optional]

Find symbols matching arg.

--symbol-info|-U [arg]

Get cursor info for this location.

--status|-s [optional]

Dump status of rdm. Arg can be symbols or symbolNames.

--diagnose [arg]

Resend diagnostics for file.

--diagnose-all

Resend diagnostics for all files.

--last-indexed

Get timestamp of the last time indexing completed for the current project.

--is-indexed|-T [arg]

Check if rtags knows about, and is ready to return information about, this source file.

--is-indexing [optional]

Check if rtags is currently indexing files in any project or in project matching pattern.

--has-filemanager [optional]

Check if rtags has info about files in this directory.

--preprocess|-E [arg]

Preprocess file.

--asm [arg]

Assemble file.

--reindex|-V [optional]

Reindex all files or all files matching pattern.

--check-reindex|-x [optional]

Check if reindexing is necessary for all files matching pattern.

--path|-P [optional]

Print files matching pattern.

--current-project

Print path for current project.

--dump-file|-d [arg]

Dump source file.

--check-includes [arg]

Check includes for source file.

--dump-file-maps [arg]

Dump file maps for file.

--generate-test [arg]

Generate a test for a given source file.

--rdm-log|-g

Receive logs from rdm.

--fixits [arg]

Get fixits for file.

--remove|-D [arg]

Remove file from project.

--find-project-root [arg]

Use to check behavior of find-project-root.

--find-project-build-root [arg]

Use to check behavior of find-project-root for builds.

--include-file [arg]

Use to generate include statement for symbol.

--sources [optional]

Dump sources for source file.

--dependencies [arg]

Dump dependencies for source file [(includes, included-by, depends-on, depended-on, tree-depends-on, raw)].

--all-dependencies

Dump dependencies for all source files [(includes, included-by, depends-on, depended-on, tree-depends-on, raw)].

--reload-file-manager|-B

Reload file manager.

--code-complete-at|-l [arg]

Code complete at location: arg is file:line:col.

--send-diagnostics [arg]

Only for debugging. Send data to all -G connections.

--dump-completions

Dump cached completions.

--dump-compile-commands

Dump compilation database for project.

--set-buffers [optional]

Set active buffers (list of filenames for active buffers in editor).

--list-buffers

List active buffers.

--add-buffers [arg]

Add additional buffers.

--remove-buffers [arg]

Remove buffers.

--list-cursor-kinds

List spelling for known cursor kinds.

--class-hierarchy [arg]

Dump class hierarcy for struct/class at location.

--debug-locations [optional]

Manipulate debug locations.

--validate

Validate database files for current project.

--tokens [arg]

Dump tokens for file. --tokens file.cpp:123-321 for range.

--find-dead-functions [optional]

Find functions declared/defined in the current file that are never used in the project.

### Command flags:
--strip-paren|-p

Strip parens in various contexts.

--max|-M [arg]

Max lines of output for queries.

--reverse-sort|-O

Sort output reversed.

--rename

Used for --references to indicate that we're using the results to rename symbols.

--unsaved-file [arg]

Pass unsaved file on command line. E.g. --unsaved-file=main.cpp:1200 then write 1200 bytes on stdin.

--log-file|-L [arg]

Log to this file.

--no-context|-N

Don't print context for locations.

--path-filter|-i [arg]

Filter out results not matching with arg.

--dependency-filter [arg]

Filter out results unless argument depends on them.

--range-filter [arg]

Filter out results not in the specified range.

--filter-system-headers|-H

Don't exempt system headers from path filters.

--all-references|-e

Include definitions/declarations/constructors/destructors for references. Used for rename symbol.

--target-usrs

Print all matching usr targets for -f. Used for debugging.

--all-targets

Print multiple targets for -f. Sorted by best match.

--elisp|-Y

Output elisp: (list "one" "two" ...).

--json

Output json.

--json-diagnostics-include-skipped

Output json diagnostics with skipped ranges.

--diagnostics|-m

Receive async formatted diagnostics from rdm.

--match-regexp|-Z

Treat various text patterns as regexps (-P, -i, -V, -F).

--match-icase|-I

Match case insensitively

--absolute-path|-K

Print files with absolute path.

--socket-file|-n [arg]

Use this socket file (default is XDG_RUNTIME_DIR/rdm.socket else ~/.rdm)

--socket-address [arg]

Use this host:port combination (instead of --socket-file).

--timeout|-y [arg]

Max time in ms to wait for job to finish (default no timeout).

--find-virtuals|-k

Use in combinations with -R or -r to show other implementations of this function.

--find-file-prefer-exact|-A

Use to make --find-file prefer exact matches over partial matches.

--symbol-info-include-parents

Use to make --symbol-info include parent symbols.

--symbol-info-include-targets

Use to make --symbol-info include target symbols.

--symbol-info-include-references

Use to make --symbol-info include reference symbols.

--symbol-info-include-base-classes

Use to make --symbol-info include baseclasses' symbols.

--symbol-info-include-source-code

Use to make --symbol-info include source code.

--cursor-kind

Include cursor kind in --find-symbols output.

--display-name

Include display name in --find-symbols output.

--current-file [arg]

Pass along which file is being edited to give rdm a better chance at picking the right project.

--declaration-only|-G

Filter out definitions (unless inline).

--definition-only

Filter out declarations (unless inline).

--kind-filter [arg]

Only return results matching this kind.

--containing-function|-o

Include name of containing function in output.

--containing-function-location

Include location of containing function in output.

--build-index [arg]

For sources with multiple builds, use the arg'th.

--compilation-flags-only

For --source, only print compilation flags.

--compilation-flags-split-line

For --source, print one compilation flag per line.

--compilation-flags-pwd

For --source, print pwd for compile command on the first line.

--dump-include-headers

For --dump-file, also dump dependencies.

--silent-query

Don't log this request in rdm.

--synchronous-completions

Wait for completion results and print them to stdout.

--synchronous-diagnostics

Wait for diagnostics and print them to stdout.

--xml

Output XML

--no-sort-references-by-input

Don't sort references by input position.

--project-root [arg]

Override project root for compile commands.

--rtags-config [arg]

Print out .rtags-config for argument.

--wildcard-symbol-names|-a

Expand * like wildcards in --list-symbols and --find-symbols.

--no-color|-z

Don't colorize context.

--wait

Wait for reindexing to finish.

--code-complete-include-macros

Include macros in code completion results.

--code-complete-includes

Give includes in completion results.

--code-complete-no-wait

Don't wait for synchronous completion if the translation unit has to be created.

--code-complete-prefix [arg]

Filter out code completion results that don't start with this prefix.

--code-completion-enabled|-b

Inform rdm that we're code-completing. Use with --diagnose

--no-spell-checking

Don't produce spell check info in diagnostics.

--tokens-include-symbols

Include symbols for tokens.

--no-realpath

Don't resolve paths using realpath(3).

--include-path [arg]

Dump include path for symbol.

--max-depth [arg]

Max search depth. Used for --include-path.

## SEE ALSO
rdm(7)


rdm

title: rdm(7)

summary: manual page for rdm 2.41.133

text:
# rdm(7)

## NAME
rdm - manual page for rdm 2.41.133

## SYNOPSIS
rdm [OPTION]...

## DESCRIPTION
RTags is a client/server application that indexes C/C++ code and keeps a persistent file-based database of references, declarations, definitions, symbolnames etc. There's also limited support for ObjC/ObjC++. It allows you to find symbols by name (including nested class and namespace scope). Most importantly we give you proper follow-symbol and find-references support. We also have neat little things like rename-symbol, integration with clang's "fixits" (http://clang.llvm.org/diagnostics.html). We also integrate with flymake using clang's vastly superior errors and warnings. Since RTags constantly will reindex "dirty" files you get live updates of compiler errors and warnings. Since we already know how to compile your sources we have a way to quickly bring up the preprocessed output of the current source file in a buffer.

While existing taggers like gnu global, cscope, etags, ctags etc do a decent job for C they often fall a little bit short for C++. With its incredible lexical complexity, parsing C++ is an incredibly hard task and we make no bones about the fact that the only reason we are able to improve on the current tools is because of clang (http://clang.llvm.org/). RTags is named RTags in recognition of Roberto Raggi on whose C++ parser we intended to base this project but he assured us clang was the way to go. The name stuck though.

## OPTIONS
--help|-h

Display this page.

--version

Display version.

--include-path|-I [arg]

Add additional include path to clang.

--no-libclang-include-path

Don't use the include path from libclang.

--isystem|-s [arg]

Add additional system include path to clang.

--define|-D [arg]

Add additional define directive to clang.

--default-argument [arg]

Add additional argument to clang.

--log-file|-L [arg]

Log to this file.

--crash-dump-file [arg]

File to dump crash log to (default is <datadir>/crash.dump).

--setenv|-e [arg]

Set this environment variable (--setenv "foobar=1").

--no-Wall|-W

Don't use -Wall.

--Weverything|-u

Use -Weverything.

--verbose|-v

Change verbosity, multiple -v's are allowed.

--job-count|-j [arg]

Spawn this many concurrent processes for indexing (default to the number of available processing units or 2 otherwise).

--test|-t [arg]

Run this test.

--tempdir [arg]

Use this directory for temporary files. Clang generates a lot of these and rtags will periodically clean out this directory (default is $TMPDIR/rtags/)

--test-timeout|-z [arg]

Timeout for test to complete.

--clean-slate|-C

Clear out all data.

--disable-sighandler|-x

Disable signal handler to dump stack for crashes.

--silent|-S

No logging to stdout/stderr.

--exclude-filter|-X [arg]

Files to exclude from rdm (default "*/CMakeFiles/*;*/cmake*/Modules/*;*/conftest.c*;/tmp/*;/private/tmp/*;/private/var/*".)

--socket-file|-n [arg]

Use this file for the server socket (default is XDG_RUNTIME_DIR/rdm.socket else ~/.rdm).

--data-dir|-d [arg]

Use this directory to store persistent data (default $XDG_CACHE_HOME/rtags otherwise ~/.cache/rtags).

--ignore-printf-fixits|-F

Disregard any clang fixit that looks like it's trying to fix format for printf and friends.

--error-limit|-f [arg]

Set error limit to argument (-ferror-limit={arg} (default 50).

--block-argument|-G [arg]

Block this argument from being passed to clang. E.g. rdm --block-argument -fno-inline

--no-spell-checking|-l

Don't pass -fspell-checking.

--large-by-value-copy|-r [arg]

Use -Wlarge-by-value-copy=[arg] when invoking clang.

--allow-multiple-sources|-m

Don't merge source files added with -c.

--no-startup-project|-o

Don't restore the last current project on startup.

--no-no-unknown-warnings-option|-Y

Don't pass -Wno-unknown-warning-option.

--ignore-compiler|-b [arg]

Ignore this compiler.

--compiler-wrappers [arg]

Consider these filenames compiler wrappers (split on ;), default "ccache".

--watch-system-paths|-w

Watch system paths for changes.

--rp-visit-file-timeout|-Z [arg]

Timeout for rp visitfile commands in ms (0 means no timeout) (default 60000).

--rp-indexer-message-timeout|-T [arg]

Timeout for rp indexer-message in ms (0 means no timeout) (default 60000).

--rp-connect-timeout|-O [arg]

Timeout for connection from rp to rdm in ms (0 means no timeout) (default 0).

--rp-connect-attempts [arg]

Number of times rp attempts to connect to rdm before giving up. (default 3).

--rp-nice-value|-a [arg]

Nice value to use for rp (nice(2)) (default is no nicing).

--suspend-rp-on-crash|-q

Suspend rp in SIGSEGV handler (default off).

--rp-log-to-syslog

Make rp log to syslog.

--start-suspended|-Q

Start out suspended (no reindexing enabled).

--separate-debug-and-release|-E

Normally rdm doesn't consider release and debug as different builds. Pass this if you want it to.

--separate-32-bit-and-64-bit

Normally rdm doesn't consider -m32 and -m64 as different builds. Pass this if you want it to.

--ignore-include-path-differences-in-usr Don't consider sources that only differ in includepaths within /usr (not including /usr/home/) as different builds.

--max-crash-count|-K [arg]

Max number of crashes before giving up a sourcefile (default 5).

--max-socket-write-buffer-size [arg]

Max number of bytes buffered after EAGAIN.

--completion-cache-size|-i [arg]

Number of translation units to cache (default 10).

--completion-no-filter

Don't filter private members and destructors from completions.

--completion-logs

Log more info about completions.

--completion-diagnostics [optional]

Send diagnostics from completion thread.

--rp-daemon [arg]

Keep this many rp daemons alive and cache the last tu. Default to 1

--max-include-completion-depth [arg]

Max recursion depth for header completion (default 3).

--allow-Wpedantic|-P

Don't strip out -Wpedantic. This can cause problems in certain projects.

--allow-Werror

Don't strip out -Werror and -Wfatal-errors. By default these are stripped out.

--enable-compiler-manager|-R

Query compilers for their actual include paths instead of letting clang use its own. This is now the default. Kept for backwards compatibility.

--disable-compiler-manager

Do not query compilers for their actual include paths instead of letting clang use its own.

--enable-NDEBUG|-g

Don't remove -DNDEBUG from compile lines.

--progress|-p

Report compilation progress in diagnostics output.

--max-file-map-cache-size|-y [arg]

Max files to cache per query (Should not exceed maximum number of open file descriptors allowed per process) (default 500).

--no-filemanager-watch|-M

Don't use a file system watcher for filemanager.

--no-filemanager

Don't scan project directory for files. (rc -P won't work).

--no-file-lock

Disable file locking. Not entirely safe but might improve performance on certain systems.

--pch-enabled

Enable PCH (experimental).

--no-filesystem-watcher|-B

Disable file system watching altogether. Reindexing has to be triggered manually.

--arg-transform|-V [arg]

Use arg to transform arguments. [arg] should be executable with (execv(3)).

--no-comments

Don't parse/store doxygen comments.

--inactivity-timeout [arg]

Time in seconds after which rdm will quit if there's been no activity (N.B., once rdm has quit, something will need to re-run it!).

--daemon

Run as daemon (detach from terminal).

--log-file-log-level [arg]

Log level for log file (default is error), options are: error, warning, debug or verbose-debug.

--watch-sources-only

Only watch source files (not dependencies).

--debug-locations [arg]

Set debug locations.

--validate-file-maps

Spend some time validating project data on startup.

--tcp-port [arg]

Listen on this tcp socket (default none).

--rp-path [arg]

Path to rp.

--log-timestamp

Add timestamp to logs.

--log-flush

Flush stderr/stdout after each log.

--sandbox-root [arg]

Create index using relative paths by stripping dir (enables copying of tag index db files without need to reindex).

--poll-timer [arg]

Poll the database of the current project every <arg> seconds.

--no-realpath

Don't use realpath(3) for files

--config|-c [arg]

Use this file (instead of ~/.rdmrc).

--no-rc|-N

Don't load any rc files.

## SEE ALSO
rc(7)