diff options
| author | Michael Biebl <biebl@debian.org> | 2022-08-16 18:24:19 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-08-16 18:24:19 +0200 |
| commit | 0018d1f3cf71d680d7b6bceda55a5717244d8b26 (patch) | |
| tree | a058f1d106d172d3354179437ef034c9355cdf9c /docs/api/html/nmcli-examples.html | |
| parent | 6accbd3ec0e42d8633bbde4d47ed7bfe854e7e0b (diff) | |
New upstream version 1.39.90 upstream/1.39.90
Diffstat (limited to 'docs/api/html/nmcli-examples.html')
| -rw-r--r-- | docs/api/html/nmcli-examples.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/api/html/nmcli-examples.html b/docs/api/html/nmcli-examples.html index 2bc6cbc2..0a832ab7 100644 --- a/docs/api/html/nmcli-examples.html +++ b/docs/api/html/nmcli-examples.html @@ -633,6 +633,62 @@ Connection 'ethernet-4' (de89cdeb-a3e1-4d53-8fa0-c22546c775f4) successfully <pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>nmcli connection add type bluetooth con-name "My Bluetooth Hotspot" autoconnect no ifname btnap0 bluetooth.type nap ipv4.method shared ipv6.method shared</code></strong></pre> </div> </div> +<br class="example-break"><div class="example"> +<a name="id-1.2.7.6.20"></a><p class="title"><b>Example 18. Offline use</b></p> +<div class="example-contents"> +<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>nmcli --offline con add type ethernet ' + conn.id eth0 \ + conn.interface-name eth0 \ + >/sysroot/etc/NetworkManager/system-connections/eth0.nmconnection</code></strong></pre> +<p> + Creates a connection file in keyfile format without using the NetworkManager service. + This allows for use of familiar <span class="command"><strong>nmcli</strong></span> 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. + </p> +<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>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</code></strong></pre> +<p> + Read and write a connection file without using the NetworkManager service, modifying + some properties along the way. + </p> +<p> + This allows templating of the connection profiles using familiar + <span class="command"><strong>nmcli</strong></span> syntax in situations where the service is not running. + </p> +</div> +</div> +<br class="example-break"><div class="example"> +<a name="id-1.2.7.6.21"></a><p class="title"><b>Example 19. Device Checkpoint and Restore</b></p> +<div class="example-contents"> +<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>nmcli dev checkpoint eth0 -- nmcli dev dis eth0</code></strong> +Device 'eth0' successfully disconnected. +Type "Yes" to commit the changes: No +Checkpoint was removed.</pre> +<p> + 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. + </p> +<p> + If the command being run unintentionaly brings down the remote connection + (such as a + <span class="citerefentry"><span class="refentrytitle">ssh</span>(1)</span> + 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. + </p> +<p> + 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: + </p> +<pre class="screen"><code class="prompt">$ </code><strong class="userinput"><code>nmcli dev checkpoint -- ip link del br0</code></strong> +Type "Yes" to commit the changes: <strong class="userinput"><code>Yes</code></strong></pre> +</div> +</div> <br class="example-break"> </div> <div class="refsect1"> |