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

相关推荐
yyy00020010 分钟前
BGP联邦实验
网络
为美好的生活献上中指28 分钟前
java每日精进 5.11【WebSocket】
java·javascript·css·网络·sql·websocket·网络协议
三天不学习29 分钟前
如何配置光猫+路由器实现外网IP访问内部网络?
网络·tcp/ip·智能路由器
小诸葛的博客2 小时前
Flannel UDP 模式的优缺点
网络协议·udp·php
EasyDSS2 小时前
AI智能分析网关V4助力工厂/工地/车间/能源矿山场景玩手机行为精准检测与安全生产智能化监管
网络·人工智能
189228048613 小时前
NY182NY183美光固态颗粒NY186NY188
大数据·网络·科技
桃子酱紫君3 小时前
华为配置篇-RSTP/MSTP实验
开发语言·华为·php
hgdlip3 小时前
手机换地方ip地址会变化吗?深入解析
网络·tcp/ip·智能手机
hgdlip3 小时前
手机换IP真的有用吗?可以干什么?
网络·tcp/ip·手机
养海绵宝宝的小蜗4 小时前
BGP练习
网络·智能路由器