「Netplan」- 操作系统网络配置工具(Ubuntu)

认识

Netplan,网络配置抽象渲染器,是个用于在 Linux 系统上轻松配置网络的实用程序。只需创建所需网络接口的 YAML 描述以及每个接口应配置的内容。根据此描述,Netplan 将为您选择的渲染器工具生成所有必要的配置。

应用

修改网络接口名称 NIC Naming

networking – How to rename a network interface in 20.04 – Ask Ubuntu

根据 Netplan 文档,通过 MAC Address 匹配设备,然后修改名称:

network:
  ethernets:

    eth0:
      match:
        macaddress: b4:05:5d:02:d5:6c
      set-name: eth0

    eth1:
      match:
        macaddress: b4:05:5d:02:d5:6d
      set-name: eth1

    fibre0:
      match:
        macaddress: b4:05:5d:02:d5:6a
      set-name: fibre0

    fibre1:
      match:
        macaddress: b4:05:5d:02:d5:6b
      set-name: fibre1

  version: 2

改进

# 04/02/2021 在 Ubuntu 18.4 TLS / Netplan 1.10.1 中,无法配置 /etc/resolv.conf 的 options single-request 选项。

参考

Netplan | Backend-agnostic network configuration in YAML