yycvip 发表于 2024-6-15 19:48:17

Ubuntu 24.04 LTS修改和配置IP地址

1.修改网络配置
vi /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:
      enp1s0:
            addresses:
            - 192.168.1.20/24
            nameservers:
                addresses:
                - 222.74.1.200
                search:
                - 222.74.126.230
            routes:
            -   to: default
                via: 192.168.1.1
    version: 2
    wifis: {}2.使之生效
netplan apply


页: [1]
查看完整版本: Ubuntu 24.04 LTS修改和配置IP地址