Pi OS Bookworm 无法连接有线网问题的修复

1 month ago
0 comment

编写日期:2024 年 6 月 10 日,请注意时效性

在使用 Raspberry Pi Imager 烧录 Pi OS 的时候如果配置了 WiFi,则似乎会触发 Bug 导致无法连接有线网。这是因为网络配置文件 /etc/netplan/50-cloud-init.yaml 中没有关于有线网络的配置信息导致的(Pi Imager 可能是直接覆写了配置文件)。

修改该文件为大概以下内容则可以修复问题:

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
    wifis:
        renderer: networkd
        wlan0:
            access-points:
                <your-wifi-ssid>:
                    password: <your-wifi-password>
            dhcp4: true
            optional: true