fix: 修复 Ubuntu Netplan static/dhcp 模式缺少 ethernets 层导致 netplan apply 报错

接口名直接挂在 network: 下导致 'unknown key' 错误,
现在正确放在 ethernets: 下面。
This commit is contained in:
Your Name
2026-08-07 10:35:47 +08:00
parent c9ed2488e6
commit 70e196045c
+3 -1
View File
@@ -250,9 +250,11 @@ export function generateNetworkUbuntuNetplan(config) {
const body = [] // 每个元素是一行,已包含完整缩进
if (config.configType === 'static') {
body.push(` ethernets:`)
body.push(` ${config.interface}:`)
body.push(...genIp(4))
body.push(...genIp(6))
} else if (config.configType === 'dhcp') {
body.push(` ethernets:`)
body.push(` ${config.interface}:`)
body.push(` dhcp4: true`)
if (dnsList.length > 0) {