[networking-guide] master: nmcli updates for Fed21 (4196bb9)

stephenw at fedoraproject.org stephenw at fedoraproject.org
Tue Jan 6 20:41:25 UTC 2015


Repository : http://git.fedorahosted.org/cgit/docs/networking-guide.git

On branch  : master

>---------------------------------------------------------------

commit 4196bb97422f37abb3e1cfada4c0c278975f64d4
Author: Stephen Wadeley <swadeley at redhat.com>
Date:   Tue Jan 6 21:31:31 2015 +0100

    nmcli updates for Fed21


>---------------------------------------------------------------

 en-US/Configure_Networking.xml |  222 ++++++++++++++++++++++++++++++++++------
 1 files changed, 188 insertions(+), 34 deletions(-)

diff --git a/en-US/Configure_Networking.xml b/en-US/Configure_Networking.xml
index d2a7470..7467540 100644
--- a/en-US/Configure_Networking.xml
+++ b/en-US/Configure_Networking.xml
@@ -1685,8 +1685,8 @@ See the <filename>ip-route(8)</filename> man page for more details on the option
 <para>
 Use the <command>ip route</command> command without options to display the <systemitem class="protocol">IP</systemitem> routing table. For example:
 <screen>~]$&nbsp;ip route
-default via 192.168.122.1 dev ens9  proto static  metric 1024
-192.168.122.0/24 dev ens9  proto kernel  scope link  src 192.168.122.107
+default via 192.168.122.1 dev eth1  proto static  metric 1024
+192.168.122.0/24 dev eth1  proto kernel  scope link  src 192.168.122.107
 192.168.122.0/24 dev eth0  proto kernel  scope link  src 192.168.122.126</screen>
 </para>
 
@@ -1879,10 +1879,12 @@ OBJECT
 <screen>~]$&nbsp;<command>nmcli general help</command>
 Usage: nmcli general { COMMAND | help }
 
-  COMMAND := { status | permissions | logging }
+  COMMAND := { status | hostname | permissions | logging }
 
   status
 
+  hostname [&lt;hostname&gt;]
+
   permissions
 
   logging [level &lt;log level&gt;] [domains &lt;log domains&gt;]</screen>
@@ -2001,46 +2003,198 @@ For example:
   <para>
     To list the currently available network connections, issue a command as follows:
     <screen>~]$&nbsp;<command>nmcli con show</command>
-NAME               UUID                     TYPE            TIMESTAMP-REAL
-eth0               4d5c449a-a6c5-451c-8206  802-3-ethernet  Tue 22 Oct 2013 19:50:00 BST
-MyWiFi             91451385-4eb8-4080-8b82  802-11-wireless Tue 22 Oct 2013 08:50:08 BST
-Bond connection 1  720aab83-28dd-4598-9325  bond            never</screen>
-Note that the NAME field in the output always denotes the connection ID (name). It is not the interface name even though it might look the same. In the example above <literal>eth0</literal> is the connection ID given by the user to the profile applied to the interface <interface>eth0</interface>. In the second line the user has assigned the connection ID <literal>MyWiFi</literal> to the interface <interface>wlan0</interface>.
+NAME  UUID                                  TYPE            DEVICE 
+eth0  96a5deb0-5eb0-41e1-a7ed-38fea413f9c8  802-3-ethernet  eth0
+MyWiFi             91451385-4eb8-4080-8b82  802-11-wireless wlan0</screen>
+Note that the NAME field in the output always denotes the connection ID (name). It is not the interface name even though it might look the same. In the example above <literal>eth0</literal> is the connection ID given by the user to the profile applied to the interface <interface>eth0</interface>. In the second line the user has assigned the connection ID <literal>MyWiFi</literal> to the interface <literal>wlan0</literal>.
 </para>
  <para>
-Device status can also be viewed:
+      Adding an Ethernet connection means creating a configuration profile which is then assigned to a device. Before creating a new profile, review the available devices 
+ as follows:
 <screen>~]$&nbsp;<command>nmcli dev status</command>
-DEVICE      TYPE            STATE
-wlan0      802-11-wireless  connected
-bond0       bond            connecting (getting IP configuration)
-eth0        ethernet        disconnected
-lo          loopback        unmanaged</screen>
+DEVICE  TYPE      		STATE         CONNECTION
+wlan0   wifi  		    connected     my-ssid
+eth0    ethernet  		unavailable   --
+lo      loopback  		unmanaged     --</screen>
   </para>
 
-    <bridgehead id="Adding_an_Ethernet_Connection">Adding an Ethernet Connection</bridgehead>
+    <bridgehead id="Adding_a_Dynamic_Ethernet_Connection">Adding a Dynamic Ethernet Connection</bridgehead>
     <para>
-    To add an Ethernet connection with static <systemitem class="protocol">IP</systemitem> configuration, issue a command as follows:
-    <screen>~]$&nbsp;<command>nmcli con add con-name <replaceable>my-eth1</replaceable> ifname <replaceable>eth1</replaceable> type ethernet ip4 192.168.100.100/24 \</command>
-      <command>gw4 192.168.100.1</command></screen>
-     Optionally, at the same time specify <systemitem class="protocol">IPv6</systemitem> addresses for the device as follows:
-     <screen>~]$&nbsp;<command>nmcli con add con-name <replaceable>my-eth1</replaceable> ifname <replaceable>eth1</replaceable> type ethernet ip4 192.168.100.100/24 \</command>
-<command> gw4 192.168.100.1 ip6 abbe::cafe gw6 2001:db8::1</command></screen>
-      To add two <systemitem class="protocol">IPv4</systemitem> <systemitem class="protocol">DNS</systemitem> server addresses:
-      <screen>~]$&nbsp;<command>nmcli con mod <replaceable>my-eth1</replaceable> ipv4.dns "8.8.8.8 8.8.4.4"</command></screen>
-        To add two <systemitem class="protocol">IPv6</systemitem> <systemitem class="protocol">DNS</systemitem> server addresses:
-        <screen>~]$&nbsp;<command>nmcli con mod <replaceable>my-eth1</replaceable> ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"</command></screen>
-        To bring up the new connection, issue a command as follows:
-        <screen>~]$&nbsp;<command>nmcli -p con up "<replaceable>my-eth1</replaceable>" ifname <replaceable>eth1</replaceable></command></screen>
+          To add an Ethernet configuration profile with dynamic <systemitem class="protocol">IP</systemitem> configuration, allowing <systemitem class="protocol">DHCP</systemitem> to assign the network configuration, a command in the following format can be used:
+          <synopsis>nmcli connection add type ethernet con-name <replaceable>connection-name</replaceable> ifname <replaceable>interface-name</replaceable></synopsis></para>
+          <para>
+          For example, to create a dynamic connection profile named <replaceable>my-office</replaceable>, issue a command as follows:
+    <screen>~]$&nbsp;<command>nmcli con add type ethernet con-name <replaceable>my-office</replaceable> ifname <replaceable>eth0</replaceable></command>
+Connection 'my-office' (0a053110-5361-412c-a4fb-6ff20877e9e4) successfully added.</screen>
+      <application>NetworkManager</application> will set its internal parameter <option>connection.autoconnect</option> to <literal>yes</literal>. <application>NetworkManager</application> will also write out settings to <filename>/etc/sysconfig/network-scripts/ifcfg-my-office</filename> where the ONBOOT directive will be set to <literal>yes</literal>.</para>
+      <para>
+      Note that manual changes to the ifcfg file will not be noticed by <application>NetworkManager</application> until the interface is next brought up. See <xref linkend="sec-Network_Configuration_Using_sysconfig_Files" /> for more information on using configuration files.</para>
+      <para>
+      To bring up the Ethernet connection, issue a command as follows:
+      <screen>~]$&nbsp;<command>nmcli con up <replaceable>my-office</replaceable></command>
+Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)</screen>
+Review the status of the devices and connections:
+<screen>~]$&nbsp;<command>nmcli device status</command>
+DEVICE  TYPE      STATE         CONNECTION
+eth0    ethernet  connected     my-office
+lo      loopback  unmanaged     --</screen>
+    </para>
+
+<para>
+  To change the host name sent by a host to a <systemitem class="protocol">DHCP</systemitem> server, modify the <option>dhcp-hostname</option> property as follows:
+  <screen>~]$&nbsp;<command>nmcli con modify my-office  <replaceable>my-office</replaceable> ipv4.dhcp-hostname <replaceable>host-name</replaceable> ipv6.dhcp-hostname <replaceable>host-name</replaceable></command></screen>
+</para>
+
+<para>
+  To change the <systemitem class="protocol">IPv4</systemitem> client ID sent by a host to a <systemitem class="protocol">DHCP</systemitem> server, modify the <option>dhcp-client-id</option> property as follows:
+  <screen>~]$&nbsp;<command>nmcli con modify my-office  <replaceable>my-office</replaceable> ipv4.dhcp-client-id <replaceable>client-ID-string</replaceable></command></screen>
+  There is no <option>dhcp-client-id</option> property for <systemitem class="protocol">IPv6</systemitem>, <application>dhclient</application> creates an identifier for <systemitem class="protocol">IPv6</systemitem>. See the <filename>dhclient(8)</filename> man page for details.
+</para>
+
+
+<para>
+  To ignore the <systemitem class="protocol">DNS</systemitem> servers sent to a host by a <systemitem class="protocol">DHCP</systemitem> server, modify the <option>ignore-auto-dns</option> property as follows:
+  <screen>~]$&nbsp;<command>nmcli con modify my-office  <replaceable>my-office</replaceable> ipv4.ignore-auto-dns <replaceable>yes</replaceable> ipv6.ignore-auto-dns <replaceable>yes</replaceable></command></screen>
+</para>
+
+<para>
+  See the <filename>nm-settings(5)</filename> man page for more information on properties and their settings.
+</para>
+
+<example id="ex-Configuring_a_Dynamic_Ethernet_Connection_Using_the_Interactive_Editor">
+<title>Configuring a Dynamic Ethernet Connection Using the Interactive Editor</title>
+
+<para>
+  To configure a dynamic Ethernet connection using the interactive editor, issue commands as follows:
+  <screen>~]$&nbsp;<command>nmcli con edit type ethernet con-name <replaceable>eth0</replaceable></command>
+
+===| nmcli interactive connection editor |===
+
+Adding a new '802-3-ethernet' connection
+
+Type 'help' or '?' for available commands.
+Type 'describe [&lt;setting&gt;.&lt;prop&gt;]' for detailed property description.
+
+You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb
+nmcli> describe ipv4.method
+
+=== [method] ===
+[NM property description]
+IPv4 configuration method.  If 'auto' is specified then the appropriate automatic method (DHCP, PPP, etc) is used for the interface and most other properties can be left unset.  If 'link-local' is specified, then a link-local address in the 169.254/16 range will be assigned to the interface.  If 'manual' is specified, static IP addressing is used and at least one IP address must be given in the 'addresses' property.  If 'shared' is specified (indicating that this connection will provide network access to other computers) then the interface is assigned an address in the 10.42.x.1/24 range and a DHCP and forwarding DNS server are started, and the interface is NAT-ed to the current default network connection.  'disabled' means IPv4 will not be used on this connection.  This property must be set.
+
+nmcli> set ipv4.method auto
+nmcli> save
+Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection.
+Do you still want to save? [yes] yes
+Connection 'eth0' (090b61f7-540f-4dd6-bf1f-a905831fc287) successfully saved.
+nmcli> quit
+~]$</screen>
+The default action is to save the connection profile as persistent. If required, the profile can be held in memory only, until the next restart, by means of the <command>save temporary</command> command.
+</para>
+
+</example>
+
+    <bridgehead id="Adding_a_Static_Ethernet_Connection">Adding a Static Ethernet Connection</bridgehead>
+    <para>
+    To add an Ethernet connection with static <systemitem class="protocol">IPv4</systemitem> configuration, a command in the following format can be used:
+          <synopsis>nmcli connection add type ethernet con-name <replaceable>connection-name</replaceable> ifname <replaceable>interface-name</replaceable> ip4 <replaceable>address</replaceable> gw4 <replaceable>address</replaceable></synopsis>
+   <systemitem class="protocol">IPv6</systemitem> address and gateway information can be added using the <option>ip6</option> and <option>gw6</option> options.</para>
+   <para>
+   For example, a command to create a static Ethernet connection with only <systemitem class="protocol">IPv4</systemitem> address and gateway is as follows:
+        <screen>~]$&nbsp;<command>nmcli con add type ethernet con-name <replaceable>test-lab</replaceable> ifname <replaceable>eth1</replaceable> ip4 10.10.10.10/24 \</command>
+<command>gw4 10.10.10.254</command></screen>
+     Optionally, at the same time specify <systemitem class="protocol">IPv6</systemitem> address and gateway for the device as follows:
+     <screen>~]$&nbsp;<command>nmcli con add type ethernet con-name <replaceable>test-lab</replaceable> ifname <replaceable>eth1</replaceable> ip4 10.10.10.10/24 \</command>
+<command>gw4 10.10.10.254 ip6 abbe::cafe gw6 2001:db8::1</command>
+Connection 'test-lab' (05abfd5e-324e-4461-844e-8501ba704773) successfully added.</screen>
+      <application>NetworkManager</application> will set its internal parameter <option>ipv4.method</option> to <literal>manual</literal> and <option>connection.autoconnect</option> to <literal>yes</literal>. <application>NetworkManager</application> will also write out settings to <filename>/etc/sysconfig/network-scripts/ifcfg-my-office</filename> where the corresponding BOOTPROTO will be set to <literal>none</literal> and ONBOOT will be set to <literal>yes</literal>.</para>
+      <para>
+      Note that manual changes to the ifcfg file will not be noticed by <application>NetworkManger</application> until the interface is next brought up. See <xref linkend="sec-Network_Configuration_Using_sysconfig_Files" /> for more information on using configuration files.</para>
+<para>
+      To set two <systemitem class="protocol">IPv4</systemitem> <systemitem class="protocol">DNS</systemitem> server addresses:
+      <screen>~]$&nbsp;<command>nmcli con mod <replaceable>test-lab</replaceable> ipv4.dns "8.8.8.8 8.8.4.4"</command></screen>
+      Note that this will replace any previously set <systemitem class="protocol">DNS</systemitem> servers.
+        To set two <systemitem class="protocol">IPv6</systemitem> <systemitem class="protocol">DNS</systemitem> server addresses:
+        <screen>~]$&nbsp;<command>nmcli con mod <replaceable>test-lab</replaceable> ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"</command></screen>
+        Note that this will replace any previously set <systemitem class="protocol">DNS</systemitem> servers.
+Alternatively, to add additional <systemitem class="protocol">DNS</systemitem> servers to any previously set, use the <literal>+</literal> prefix as follows:
+      <screen>~]$&nbsp;<command>nmcli con mod <replaceable>test-lab</replaceable> +ipv4.dns "8.8.8.8 8.8.4.4"</command></screen>
+        <screen>~]$&nbsp;<command>nmcli con mod <replaceable>test-lab</replaceable> +ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"</command></screen>
+</para>
+        <para>
+        To bring up the new Ethernet connection, issue a command as follows:
+        <screen>~]$&nbsp;<command>nmcli con up <replaceable>test-lab</replaceable> ifname <replaceable>eth1</replaceable></command>
+Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2</screen>
+Review the status of the devices and connections:
+<screen>~]$&nbsp;<command>nmcli device status</command>
+DEVICE  TYPE      STATE      CONNECTION
+eth0    ethernet  connected  my-office
+eth1    ethernet  connected  test-lab
+lo      loopback  unmanaged  -- </screen></para>
+<para>
         To view detailed information about the newly configured connection, issue a command as follows:
-        <screen>~]$&nbsp;<command>nmcli -p con show configured <replaceable>my-eth1</replaceable></command></screen></para>
+        <screen>~]$&nbsp;<command>nmcli -p con show <replaceable>test-lab</replaceable></command>
+===============================================================================
+                     Connection profile details (test-lab)
+===============================================================================
+connection.id:                          test-lab
+connection.uuid:                        05abfd5e-324e-4461-844e-8501ba704773
+connection.interface-name:              eth1
+connection.type:                        802-3-ethernet
+connection.autoconnect:                 yes
+connection.timestamp:                   1410428968
+connection.read-only:                   no
+connection.permissions:                 
+connection.zone:                        --
+connection.master:                      --
+connection.slave-type:                  --
+connection.secondaries:                 
+connection.gateway-ping-timeout:        0
+<lineannotation>[output truncated]</lineannotation></screen>
+The use of the <option>-p, --pretty</option> option adds a title banner and section breaks to the output.</para>
+
+<example id="ex-Configuring_a_Static_Ethernet_Connection_Using_the_Interactive_Editor">
+<title>Configuring a Static Ethernet Connection Using the Interactive Editor</title>
+
+<para>
+  To configure a static Ethernet connection using the interactive editor, issue commands as follows:
+  <screen>~]$&nbsp;<command>nmcli con edit type ethernet con-name <replaceable>eth0</replaceable></command>
+
+===| nmcli interactive connection editor |===
+
+Adding a new '802-3-ethernet' connection
+
+Type 'help' or '?' for available commands.
+Type 'describe [&gt;setting&lt;.&gt;prop&lt;]' for detailed property description.
+
+You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb
+nmcli> set ipv4.addresses 192.168.122.88/24
+Do you also want to set 'ipv4.method' to 'manual'? [yes]: yes
+nmcli>
+nmcli> save temporary
+Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection.
+Do you still want to save? [yes] no
+nmcli> save
+Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection.
+Do you still want to save? [yes] yes
+Connection 'eth0' (704a5666-8cbd-4d89-b5f9-fa65a3dbc916) successfully saved.
+nmcli> quit
+~]$</screen>
+The default action is to save the connection profile as persistent. If required, the profile can be held in memory only, until the next restart, by means of the <command>save temporary</command> command.
+</para>
+
+</example>
+
+<bridgehead id="Locking_a_Profile_to_a_Specific_Device">Locking a Profile to a Specific Device</bridgehead>
         <para>
-         To lock a profile to a specific interface, issue a command as follows:
-         <screen>~]$&nbsp;<command>nmcli connection add type ethernet con-name "<replaceable>my-eth1</replaceable>" ifname eth1</command></screen>
+         To lock a profile to a specific interface device, the commands used in the examples above include the interface name. For example:
+         <synopsis>nmcli connection add type ethernet con-name <replaceable>connection-name</replaceable> ifname <replaceable>interface-name</replaceable></synopsis>
+
 To make a profile usable for all compatible Ethernet interfaces, issue a command as follows:
-         <screen>~]$&nbsp;<command>nmcli connection add type ethernet con-name "<replaceable>my-eth1</replaceable>" ifname "*"</command></screen>
-         Note that you have to use the <option>ifname</option> argument even if you do not want to set a specific interface. Use the wildcard character <literal>*</literal> to specify that the profile can be used with any compatible device.</para>
-         <para>To lock a profile to a specific MAC address, issue a command as follows:
-         <screen>~]$&nbsp;<command>nmcli connection add type ethernet con-name "<replaceable>my-eth1</replaceable>" ifname "*" mac 00:00:5E:00:53:00</command></screen> 
+<synopsis>nmcli connection add type ethernet con-name <replaceable>connection-name</replaceable> ifname "*"</synopsis>
+Note that you have to use the <option>ifname</option> argument even if you do not want to set a specific interface. Use the wildcard character <literal>*</literal> to specify that the profile can be used with any compatible device.</para>
+         <para>To lock a profile to a specific MAC address,  use a command in the following format:
+         <synopsis>nmcli connection add type ethernet con-name "<replaceable>connection-name</replaceable>" ifname "*" mac 00:00:5E:00:53:00</synopsis>
          <!-- http://www.rfc-editor.org/internet-drafts/draft-eastlake-rfc5342bis-05.txt -->
        </para>
 



More information about the docs-commits mailing list