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 文件不存在时需要创建

相关推荐
生如夏花℡14 分钟前
HarmonyOS学习记录3
学习·ubuntu·harmonyos
bing_15820 分钟前
MQTT 和 HTTP 有什么本质区别?
网络·网络协议·http
星宸追风2 小时前
Ubuntu更换Home目录所在硬盘的过程
linux·运维·ubuntu
杨浦老苏2 小时前
Docker端口映射查看工具Dockpeek
网络·docker·群晖
未来之窗软件服务2 小时前
通过网页调用身份证阅读器http websocket方法-华视电子————仙盟创梦IDE
网络·网络协议·http·仙盟创梦ide·东方仙盟·硬件接入
BD_Marathon2 小时前
Ubuntu下的Tomcat服务器部署
服务器·ubuntu·tomcat
创小匠3 小时前
创客匠人解析创始人 IP 定位:从专业度到用户心智的占领之道
网络·网络协议·tcp/ip
车载测试工程师4 小时前
车载以太网网络测试-29【SOME/IP-SD】-SD状态机
网络·网络协议·tcp/ip·车载系统·php
高兴达4 小时前
RPC--自定义注解注册发布服务
网络·网络协议·rpc
lang201509285 小时前
Reactor ConnectableFlux支持多订阅者
java·网络