# 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:2renderer:networkd # 使用 systemd-networkd 管理网络ethernets:ens33:dhcp4:false # 显式关闭 DHCPaddresses:-192.168.144.12/24 # 静态 IPv4 地址nameservers:addresses:[223.5.5.5] # DNS 服务器(阿里 DNS)search:[] # 空搜索域列表routes:-to:defaultvia:192.168.144.2 # 默认网关
# 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:
ens33:
dhcp4: yes # 启用DHCP
# 下面的设置在DHCP模式下将被忽略
# addresses:
# - 192.168.144.12/24
# nameservers:
# addresses:
# - 223.5.5.5
# search: []
routes:
# 默认路由通常由DHCP服务器提供,因此也可以省略
# - to: default
# via: 192.168.144.2