mirror of https://github.com/jetkvm/kvm.git
feat: change dhcp client
This commit is contained in:
parent
feec19ab13
commit
ed90e42324
|
|
@ -157,6 +157,11 @@ func rpcSetNetworkSettings(settings RpcNetworkSettings) (*RpcNetworkSettings, er
|
|||
|
||||
l.Debug().Msg("setting new config")
|
||||
|
||||
rebootRequired := false
|
||||
if netConfig.DHCPClient.String != config.NetworkConfig.DHCPClient.String {
|
||||
rebootRequired = true
|
||||
}
|
||||
|
||||
_ = setHostname(networkManager, netConfig.Hostname.String, netConfig.Domain.String)
|
||||
|
||||
s := networkManager.SetInterfaceConfig(NetIfName, netConfig)
|
||||
|
|
@ -176,6 +181,10 @@ func rpcSetNetworkSettings(settings RpcNetworkSettings) (*RpcNetworkSettings, er
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if rebootRequired {
|
||||
rpcReboot(false)
|
||||
}
|
||||
|
||||
return toRpcNetworkSettings(newConfig), nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -759,6 +759,7 @@ export interface IPv6StaticConfig {
|
|||
}
|
||||
|
||||
export interface NetworkSettings {
|
||||
dhcp_client: string;
|
||||
hostname: string | null;
|
||||
domain: string | null;
|
||||
http_proxy: string | null;
|
||||
|
|
|
|||
|
|
@ -334,6 +334,17 @@ export default function SettingsNetworkRoute() {
|
|||
/>
|
||||
</SettingsItem>
|
||||
|
||||
<SettingsItem title="DHCP client" description="Configure which DHCP client to use (reboot required)">
|
||||
<SelectMenuBasic
|
||||
size="SM"
|
||||
options={[
|
||||
{ value: "jetdhcpc", label: "JetKVM" },
|
||||
{ value: "udhcpc", label: "udhcpc" },
|
||||
]}
|
||||
{...register("dhcp_client")}
|
||||
/>
|
||||
</SettingsItem>
|
||||
|
||||
<SettingsItem title="IPv4 Mode" description="Configure the IPv4 mode">
|
||||
<SelectMenuBasic
|
||||
size="SM"
|
||||
|
|
|
|||
Loading…
Reference in New Issue