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

相关推荐
砚凝霜5 小时前
【软考信息安全】第二十一章 网络设备安全概述与安全机制
网络·安全
Nathan__275 小时前
PHP面试题——情景应用
开发语言·php
Escalating_xu5 小时前
【Linux 网络编程】网络基础概念(下):IP、端口、Socket 与网络字节序,写代码前先打好基础
linux·网络·tcp/ip
zbtlink6 小时前
网络卡在哪儿:空口时间、会话表容量与接入速率的可复现定位方法
网络·智能路由器
CCblandy6 小时前
Airllm 大模型本地化部署与高效推理应用指南
大数据·网络·人工智能
睡一觉就好了。7 小时前
序列化与非序列化
linux·网络
m0_715674437 小时前
金融数据流转监测排行:从看见到拦截的距离
大数据·网络·安全·网络安全·金融
3108748767 小时前
0028.配置windows的共享目录让ubuntu使用
ubuntu·windows共享文件夹
北京盛世宏博7 小时前
异地机房采集踩坑笔记:以太网温湿度记录仪跨网段通信调试实战
开发语言·笔记·单片机·php·传感器·温湿度