1. ubuntu 22.04 配置

$ vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens18:
      addresses:
      - 192.168.10.212/24
      nameservers:
        addresses:
        - 192.168.10.1
        search:
        - xiodi.cn
      routes:
      - to: default
        via: 192.168.10.1
    ens19:
      addresses:
      - 192.168.30.212/24
      nameservers:
        addresses: []
        search: []
  version: 2

$ netplan apply
WARNING:root:Cannot call Open vSwitch: ovsdb-server.service is not running.

这个警告似乎是一个 bug 问题,可以安装 openvswitch-switch 解决,不安装问题也不大。

2. ubuntu 24.04 配置

$ vim /etc/netplan/50-cloud-init.yaml
# 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:
    ethernets:
        ens18:
            addresses:
            - 192.168.11.239/24
            nameservers:
                addresses:
                - 192.168.11.1
                search:
                - xiodi.cn
            routes:
            -   to: default
                via: 192.168.11.1
    version: 2

$ netplan apply
作者:jackzang  创建时间:2024-05-11 10:51
最后编辑:jackzang  更新时间:2024-09-12 16:37