{"id":6079,"date":"2021-10-30T08:00:48","date_gmt":"2021-10-30T08:00:48","guid":{"rendered":"https:\/\/really.zonky.org\/?p=6079"},"modified":"2021-10-30T08:00:49","modified_gmt":"2021-10-30T08:00:49","slug":"linux-netplan-making-nics-optional","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=6079","title":{"rendered":"Linux Netplan: Making NICs &#8220;Optional&#8221;"},"content":{"rendered":"\n<p>Ever since adding a couple of additional network interfaces to my workstation I have had a problem with reboots &#8211; the <em>systemd-networkd-wait-online.service<\/em> service &#8220;lingers&#8221; as it waits for all of the NICs to come online (and fails). Not especially problematic as everything works fine after the boot process has finished, but it slows down reboots (which are slow enough on this rather complicated desktop) and gives me an amber \u2717 in my window manager&#8217;s status bar.<\/p>\n\n\n\n<p>After spending some time re-jigging my storage (which consisted of far too many reboots), I finally decided to fix it. <\/p>\n\n\n\n<p>Which basically consisted of making the relevant NICs &#8220;optional&#8221; in netplan. :-<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    enp9s0f1:\n      dhcp4: false\n      accept-ra: false\n      addresses: &#91;172.16.76.0\/24]\n      <strong>optional: true<\/strong><\/code><\/pre>\n\n\n\n<p>This isn&#8217;t one of the NICs that I actually use &#8211; I added the NIC configuration in an earlier attempt at making things work \u2026 unsuccessfully. The key part is the &#8220;optional: true&#8221; bit.<\/p>\n\n\n\n<p>And whilst you&#8217;re in there, replacing the <em>gatewayv4<\/em> and <em>gatewayv6<\/em> specifications with the &#8220;new style&#8221; is worth doing too :-<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>      routes:\n        - to: default\n          via: 192.0.2.1\n        - to: default\n          via: 2001:db8:9c2:dead::1<\/code><\/pre>\n\n\n\n<p>(No those aren&#8217;t the real addresses)<\/p>\n\n\n\n<p>This can be activated in the usual way &#8211; with a <em>netplan apply <\/em>(in my case a <em>netplan try<\/em> isn&#8217;t effective because of the use of bridges), although in this particular case a full reboot is called for. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"695\" height=\"521\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?resize=695%2C521&#038;ssl=1\" alt=\"\" class=\"wp-image-6066\" srcset=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?w=1682&amp;ssl=1 1682w, https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/2021-09-19-untitled.jpeg?w=1390&amp;ssl=1 1390w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><figcaption>The Round Table<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Ever since adding a couple of additional network interfaces to my workstation I have had a problem with reboots &#8211; the systemd-networkd-wait-online.service service &#8220;lingers&#8221; as it waits for all of the NICs to come online (and fails). Not especially problematic as everything works fine after the boot process has finished, but it slows down reboots <a href='https:\/\/really.zonky.org\/?p=6079' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[4,209,226],"tags":[43,2063,61],"class_list":["post-6079","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","category-working-notes","tag-linux","tag-netplan","tag-ubuntu","category-4-id","category-209-id","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-1A3","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/6079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6079"}],"version-history":[{"count":1,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/6079\/revisions"}],"predecessor-version":[{"id":6080,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/6079\/revisions\/6080"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}