fix: 修复 Ubuntu Netplan static/dhcp 模式缺少 ethernets 层导致 netplan apply 报错
接口名直接挂在 network: 下导致 'unknown key' 错误, 现在正确放在 ethernets: 下面。
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user