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 分钟前
传输控制协议(TCP)
服务器·网络·tcp/ip
positive_zpc21 分钟前
计算机网络——运输层
网络·计算机网络
克莱因35823 分钟前
思科Cisco 静态NAT
服务器·网络·思科
环流_38 分钟前
网络原理-TCP协议
服务器·网络·tcp/ip
61900833639 分钟前
win wsl2 指定目录安装Ubuntu-24.04开启ssh sftp
linux·ubuntu·ssh
路溪非溪1 小时前
wireshark抓包来看下TCP协议
网络·tcp/ip·wireshark
锅挤1 小时前
计算机网络复习(第三章):数据链路层
网络·网络协议·计算机网络
南村群童欺我老无力.1 小时前
鸿蒙网络请求的错误处理与超时管理
网络·华为·harmonyos
志栋智能1 小时前
超自动化安全:让安全防护从“有效”到“高效”
运维·网络·人工智能·安全·自动化
北方的流星2 小时前
华三交换机MSTP+VRRP配置
运维·网络·华三