Skip to content

Commit

Permalink
templates: Update FAQ about deconfiguring interfaces, using --state p…
Browse files Browse the repository at this point in the history
…arameter (#286)

Fixes: #268

Co-authored-by: Robert Krátký <robert.kratky@canonical.com>
  • Loading branch information
slyon and rkratky authored Jun 26, 2024
1 parent cf2dc0c commit 61f24f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ <h2 id="find-the-current-dns-servers">Find the current DNS servers</h2>
<p>To determine the current DNS servers used by the system run <code>systemd-resolve --status</code> (or <code>resolvectl</code> in 18.04 and higher) and look for the &#39;DNS Servers:&#39; entry to see what DNS server is used.</p>
<h2 id="deconfigure-an-interface">Deconfigure an interface</h2>
<p>To deconfigure an interface, remove the configuration for the device from the netplan .yaml file and run <code>sudo netplan apply</code>.</p>
<p>If the interface is not configured in a .yaml file in <code>/etc/netplan</code>, it will not be configured at boot. To remove addresses manually, a user can run <code>ip address del &lt;address&gt; dev &lt;interface&gt;</code>.</p>
<p><strong>Note:</strong> <code>netplan apply</code> does not remove virtual devices, such as bridges and bonds, that have been created, even if they are no longer described in the Netplan configuration. That is because Netplan operates statelessly and is not aware of the previously defined virtual devices.</p>
<p>If the interface is not configured in a <code>.yaml</code> file in the <code>/etc/netplan</code> directory, it is not configured at boot. To remove an interface manually at runtime, run <code>ip link del dev &lt;interface&gt;</code>.</p>
<p>Alternatively, create a temporary backup of the YAML state in <code>/etc/netplan</code>: <code>mkdir -p /tmp/old_state/etc &amp;&amp; cp -r /etc/netplan /tmp/old_state/etc/</code>. After creating such state, remove the interface from <code>/etc/netplan</code> using, for example: <code>rm /etc/netplan/interface-to-delete.yaml</code>, and then apply the original state: <code>netplan apply --state /tmp/old_state</code></p>
<h2 id="use-pre-up-post-up-etc-hook-scripts">Use pre-up, post-up, etc. hook scripts</h2>
<p>Users of ifupdown may be familiar with using hook scripts (e.g pre-up, post-up, etc.) in their interfaces file. Netplan configuration does not currently support hook scripts in its configuration definition.</p>
<p>Instead to achieve this functionality with the networkd renderer users can use <a href="https://gitlab.com/craftyguy/networkd-dispatcher">networkd-dispatcher</a>. The package provides users and legacy packages hook points when specific network states are reached to aid in reacting to network state. Below is a table mapping networking states and hooks available:</p>
Expand Down

0 comments on commit 61f24f3

Please # to comment.