mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
Expose VLAN guest/DHCP addresses on the network settings
This commit is contained in:
@@ -527,6 +527,21 @@
|
||||
description="Only used in emulated mode. Allows port forwarding from guest to host.">
|
||||
<type type="qemu port forward" list="yes"/>
|
||||
</property>
|
||||
|
||||
<property name="vlan guest address" code="VgAd" type="text"
|
||||
description="IPv4 subnet of the emulated VLAN in CIDR notation (e.g. 192.168.222.0/24). Only used in shared or host mode. If empty, the existing value is preserved."/>
|
||||
|
||||
<property name="vlan guest address ipv6" code="Vga6" type="text"
|
||||
description="IPv6 prefix of the emulated VLAN (e.g. fec0::/64). Only used in shared or host mode. If empty, the existing value is preserved."/>
|
||||
|
||||
<property name="vlan dhcp start address" code="VdSt" type="text"
|
||||
description="First IPv4 address of the DHCP pool handed to the guest. Only used in shared or host mode. If empty, the existing value is preserved."/>
|
||||
|
||||
<property name="vlan dhcp end address" code="VdEn" type="text"
|
||||
description="Last IPv4 address of the DHCP pool handed to the guest. Only used in shared or host mode. If empty, the existing value is preserved."/>
|
||||
|
||||
<property name="isolate from host" code="IsFh" type="boolean"
|
||||
description="When true, the guest is isolated from the host on the shared network."/>
|
||||
</record-type>
|
||||
|
||||
<enumeration name="qemu network mode" code="QeNm" description="Mode for networking device.">
|
||||
|
||||
@@ -154,6 +154,11 @@ extension UTMScriptingConfigImpl {
|
||||
"address": config.macAddress,
|
||||
"hostInterface": config.bridgeInterface ?? "",
|
||||
"portForwards": config.portForward.map({ serializeQemuPortForward($0) }),
|
||||
"vlanGuestAddress": config.vlanGuestAddress ?? "",
|
||||
"vlanGuestAddressIpv6": config.vlanGuestAddressIPv6 ?? "",
|
||||
"vlanDhcpStartAddress": config.vlanDhcpStartAddress ?? "",
|
||||
"vlanDhcpEndAddress": config.vlanDhcpEndAddress ?? "",
|
||||
"isolateFromHost": config.isIsolateFromHost,
|
||||
]
|
||||
}
|
||||
|
||||
@@ -487,6 +492,21 @@ extension UTMScriptingConfigImpl {
|
||||
if let portForwards = record["portForwards"] as? [[AnyHashable : Any]] {
|
||||
network.portForward = portForwards.map({ unserializeQemuPortForward(from: $0) })
|
||||
}
|
||||
if let value = record["vlanGuestAddress"] as? String, !value.isEmpty {
|
||||
network.vlanGuestAddress = value
|
||||
}
|
||||
if let value = record["vlanGuestAddressIpv6"] as? String, !value.isEmpty {
|
||||
network.vlanGuestAddressIPv6 = value
|
||||
}
|
||||
if let value = record["vlanDhcpStartAddress"] as? String, !value.isEmpty {
|
||||
network.vlanDhcpStartAddress = value
|
||||
}
|
||||
if let value = record["vlanDhcpEndAddress"] as? String, !value.isEmpty {
|
||||
network.vlanDhcpEndAddress = value
|
||||
}
|
||||
if let value = record["isolateFromHost"] as? Bool {
|
||||
network.isIsolateFromHost = value
|
||||
}
|
||||
}
|
||||
|
||||
private func parseNetworkProtocol(_ value: AEKeyword?) -> QEMUNetworkProtocol? {
|
||||
|
||||
Reference in New Issue
Block a user