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

相关推荐
秋邱3 分钟前
价值升维!公益赋能 + 绿色技术 + 终身学习,构建可持续教育 AI 生态
网络·数据库·人工智能·redis·python·学习·docker
爱学习的大牛12324 分钟前
如何系统学习网络渗透测试:从入门到精通的完整指南
网络·学习
程序猿编码26 分钟前
PRINCE算法的密码生成器:原理与设计思路(C/C++代码实现)
c语言·网络·c++·算法·安全·prince
踢球的打工仔1 小时前
PHP面向对象(5)
android·java·php
t***82111 小时前
华为数据中心CE系列交换机级联M-LAG配置示例
服务器·华为·php
white-persist1 小时前
【攻防世界】reverse | Reversing-x64Elf-100 详细题解 WP
c语言·开发语言·网络·python·学习·安全·php
HKT_China2 小时前
香港电讯与Fortinet推出100G高效加密网络托管服务,迈进量子安全新时代
网络·安全
JaguarJack2 小时前
PHP Fiber 优雅协作式多任务
php·服务端
上海云盾安全满满6 小时前
高防 IP 是如何帮助数藏行业防刷
网络·网络协议·tcp/ip
9***P33410 小时前
PHP代码覆盖率
开发语言·php·代码覆盖率