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

相关推荐
汤愈韬1 分钟前
OSPF考题
网络·网络协议·网络安全·security
周淳APP4 分钟前
【HTTP1、HTTP2、HTTP3】
前端·网络·网络协议·http
WwW.-.8 分钟前
OpenClaw 技术解析:多渠道 AI Gateway 如何连接消息、Agent 与远程节点
网络·人工智能·gateway
咖啡续命又一天15 分钟前
PHP 8.2 (Windows) 安装 Redis 扩展最新教程
windows·redis·php
NEAI_N18 分钟前
离网设备的加密解密方案
linux·服务器·网络
菩提小狗21 分钟前
第22天:安全开发-PHP应用&留言板功能&超全局变量&数据库操作&第三方插件引_笔记|小迪安全2023-2024|web安全|渗透测试|
数据库·安全·php
心前阳光23 分钟前
Mirror网络库插件使用6
网络
橙汁味的风27 分钟前
1计算机网络引言
开发语言·计算机网络·php
木梯子42 分钟前
深耕商业表达与 IP 打造,卢中伟导师:以表达赋能创始人成长
服务器·网络·tcp/ip
科技块儿44 分钟前
IPv4与IPv6在IP地理定位中的技术差异解析
网络·网络协议·tcp/ip