<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>My Blog - linux</title>
    <subtitle>me: Option&lt;Job&gt; = None</subtitle>
    <link rel="self" type="application/atom+xml" href="https://prompt.eu.org/tags/linux/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://prompt.eu.org"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-09-02T00:00:00+00:00</updated>
    <id>https://prompt.eu.org/tags/linux/atom.xml</id>
    <entry xml:lang="en">
        <title>Arch VPS重启后断网</title>
        <published>2025-09-02T00:00:00+00:00</published>
        <updated>2025-09-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            swhr
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://prompt.eu.org/notes/arch-vps-no-internet/"/>
        <id>https://prompt.eu.org/notes/arch-vps-no-internet/</id>
        
        <content type="html" xml:base="https://prompt.eu.org/notes/arch-vps-no-internet/">&lt;h2 id=&quot;bug&quot;&gt;bug&lt;&#x2F;h2&gt;
&lt;p&gt;大妈的一台vps安装的是面板提供的arch镜像，一直在滚动更新。2026年4月10日维护后发现连不上，只能通过后台console进入。发现没有获取到ip。&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tldr&quot;&gt;tldr&lt;&#x2F;h2&gt;
&lt;p&gt;1.2-1版本的netplan包&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; 引入了两个有影响的改动&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;：&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;generate&#x2F;configure 被分开，导致需要手动enable &lt;code&gt;netplan-configure.service&lt;&#x2F;code&gt;，否则不会生成networkd的运行时配置&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;systemd-networkd-wait-online&lt;&#x2F;code&gt;增加了&lt;code&gt;--dns&lt;&#x2F;code&gt;flag，导致其依赖于system-resolved.service&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;解决方法:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-entity z-name z-function&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; systemctl&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; enable&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-constant z-other&quot;&gt; -&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-constant z-other&quot;&gt;-now&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; netplan-configure.service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name z-entity z-name z-function&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; systemctl&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; unmask&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; systemd-resolved&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-punctuation z-separator&quot;&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name z-entity z-name z-function&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; systemctl&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; enable&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-constant z-other&quot;&gt; -&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-constant z-other&quot;&gt;-now&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; systemd-resolved&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;jie-jue-guo-cheng&quot;&gt;解决过程&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;检查网卡名字变化
&lt;ul&gt;
&lt;li&gt;没有变化&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;检查失败的systemd服务
&lt;ul&gt;
&lt;li&gt;只有&lt;code&gt;systemd-networkd-wait-online.service&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;手动写了&lt;code&gt;&#x2F;etc&#x2F;systemd&#x2F;network&#x2F;20-wired.network&lt;&#x2F;code&gt;，通过DHCP获取了地址
&lt;ul&gt;
&lt;li&gt;后缀名重要&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;奇怪之前的配置为什么不需要手动干预
&lt;ul&gt;
&lt;li&gt;发现cloud-init
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#x2F;var&#x2F;lib&#x2F;cloud&#x2F;&lt;&#x2F;code&gt;下有获取的配置信息
&lt;ul&gt;
&lt;li&gt;之前是静态分配的ip&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;知道了 datasource 和 renderer 的概念&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;为什么现在没有被render
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;systemd-networkd-wait-online.service&lt;&#x2F;code&gt;的log里有&lt;code&gt;Failed to connect to io.systemd.Resolve.Monitor&lt;&#x2F;code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;systemctl cat&lt;&#x2F;code&gt; 和 service 文件不一致&lt;&#x2F;li&gt;
&lt;li&gt;发现 systemctl generator 和 drop-in&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;被&lt;code&gt;netplan&lt;&#x2F;code&gt;的generator修改了，增加了&lt;code&gt;--dns&lt;&#x2F;code&gt;的flag&lt;&#x2F;li&gt;
&lt;li&gt;enable 了&lt;code&gt;systemd-resolvd.service&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;知道了 netplan，发现&lt;code&gt;&#x2F;etc&#x2F;netplan&#x2F;50-cloud-init.yaml&lt;&#x2F;code&gt;，之前的 renderer 应该是 netplan
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;netplan apply&lt;&#x2F;code&gt;后成功生成&lt;code&gt;&#x2F;run&#x2F;systemd&#x2F;network&#x2F;&lt;&#x2F;code&gt;下的配置，&lt;&#x2F;li&gt;
&lt;li&gt;但是重启后不会自动生成&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;paru -Ql netplan | rg service&lt;&#x2F;code&gt; 发现 &lt;code&gt;netplan-configure.service&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;启用后正常，问题解决&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;去netplan项目页找更新日志，结合vps的重启记录，发现是4月2日的更新引入新版 netplan，而&lt;code&gt;netplan-configure.service&lt;&#x2F;code&gt; 当时未启用，4月10号维护的重启只不过是提前暴露了问题&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;gitlab.archlinux.org&#x2F;archlinux&#x2F;packaging&#x2F;packages&#x2F;netplan&#x2F;-&#x2F;commit&#x2F;9a988edd4869dfc0be9d3306da47d6a0404740e2&quot;&gt;upgpkg: 1.2-1 (9a988edd)&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;canonical&#x2F;netplan&#x2F;releases&#x2F;tag&#x2F;1.2&quot;&gt;Release Netplan v1.2 · canonical&#x2F;netplan&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;section&gt;
</content>
        
    </entry>
</feed>
