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

相关推荐
C_心欲无痕9 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
sunfove9 小时前
光网络的立交桥:光开关 (Optical Switch) 原理与主流技术解析
网络
HIT_Weston10 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
HIT_Weston10 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式10 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
AI 智能服务11 小时前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php
Kevin Wang72712 小时前
欧拉系统服务部署注意事项
网络·windows
min18112345612 小时前
深度伪造内容的检测与溯源技术
大数据·网络·人工智能
汤愈韬13 小时前
Full Cone Nat
网络·网络协议·网络安全·security·huawei
zbtlink13 小时前
现在还需要带电池的路由器吗?是用来干嘛的?
网络·智能路由器