ubuntu 22.04 mini 安装,在配置网络时重启后配置文件被重置原因与解决方法

在 /etc/netplan/50-cloud-init.yaml 配置文件中有一段注释中有说明

复制代码
root@localhost:/etc/netplan# cat 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}

翻译过来就是:

修改50-cloud-init.yaml文件在重启后不会生效,除非在 /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg 配置 network: {config: disabled}.

复制代码
root@localhost:/etc/netplan# cat  /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
network: {config: disabled}

在99-disable-network-config.cfg配置文件中添加 network: {config: disabled} 参数后重启服务器网络配置文件也会生效。
99-disable-network-config.cfg 文件不存在时需要创建

相关推荐
myenjoy_19 小时前
MQTT 与 Sparkplug B——从车间到云端的最后一公里
网络·python
2401_8734794010 小时前
企业安全运营中,如何用IP离线库提前发现失陷主机?三步实现风险画像
网络·数据库·python·tcp/ip·ip
Nayxxu10 小时前
Claude API 生产稳定性设计:超时、降级、备用模型和告警怎么做
开发语言·php
代码中介商12 小时前
HTTP 完全指南(最终篇):CORS 跨域资源共享深度详解
网络·网络协议·http
liulilittle12 小时前
过冲:拥塞控制的呼吸与盲行
linux·网络·c++·tcp/ip·计算机网络·tcp·通信
狗凯之家源码网12 小时前
三角洲行动护航系统源码部署与运营指南
开源·php
兮动人12 小时前
服务器流量监控与性能优化实战
服务器·网络·性能优化·服务器流量监控与性能优化实战
San813_LDD12 小时前
[量化]《浮点数比较的艺术:从内存布局到极致性能优化》
网络·算法
Oll Correct12 小时前
实验三十一:配置DHCP中继代理
网络·笔记
茶乡浪子13 小时前
同子网基于IPv4网络静态VXLAN配置示例(下)
运维·网络·数据中心·vxlan·evpn·华为vxlan·华为数据中心网络