< Back

Set-VMHostNetwork

Sun Jan 19, 2020 7:10 pm

NAME Set-VMHostNetwork



SYNOPSIS

This cmdlet updates the specified virtual network.





SYNTAX

Set-VMHostNetwork [-Network] <VMHostNetworkInfo[]> [-ConsoleGateway <String>] [-ConsoleGatewayDevice <String>]

[-ConsoleV6Gateway <String>] [-ConsoleV6GatewayDevice <String>] [-DnsAddress <String[]>] [-DnsDhcpDevice <Object>]

[-DnsFromDhcp <Boolean>] [-DomainName <String>] [-HostName <String>] [-IPv6Enabled <Boolean>] [-SearchDomain

<String[]>] [-VMKernelGateway <String>] [-VMKernelGatewayDevice <String>] [-VMKernelV6Gateway <String>]

[-VMKernelV6GatewayDevice <String>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet updates the specified virtual network. The service console and the VMkernel are often not connected to

the same network, and therefore each needs its own gateway information. A gateway is needed for connectivity to

machines not on the same IP subnet as the service console or VMkernel.





PARAMETERS

-ConsoleGateway <String>

Specifies a new console gateway.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ConsoleGatewayDevice <String>

Specifies a new console gateway device.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ConsoleV6Gateway <String>

Specifies a console V6 gateway address. Not supported on ESXi.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ConsoleV6GatewayDevice <String>

Specifies a console V6 gateway device. Not supported on ESXi.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DnsAddress <String[]>

Specifies a new DNS address.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DnsDhcpDevice <Object>

This parameter is mandatory if the value of the DnsFromDhcp parameter is 'true'. Otherwise, it is disregarded.

If the DnsDhcpDevice parameter is set, the Dhcp DNS of the service console or VMKernel network adapter will

override the system DNS. The parameter takes a ServiceConsoleNIC object, a VMKernelNIC object in case of an

ESX visor, or the NIC name as a string.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DnsFromDhcp <Boolean>

Indicates that you want to obtain the network settings from a Dhcp server.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DomainName <String>

Specifies a new domain name.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HostName <String>

Specifies a new host name.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-IPv6Enabled <Boolean>

Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables the ConsoleV6Gateway,

ConsoleV6GatewayDevice, and VMKernelV6Gateway parameters. IPv6 is supported only on vCenter 4.1 and ESX 4.1 or

later. To use IPv6 on ESX, you must restart the host after enabling IPv6.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Network <VMHostNetworkInfo[]>

Specifies the host network you want to configure.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-SearchDomain <String[]>

Specifies a new search domain.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMKernelGateway <String>

Specifies a new kernel gateway.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMKernelGatewayDevice <String>

Specifies a new kernel gateway device.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMKernelV6Gateway <String>

Specifies a VMKernel V6 gateway address. This parameter is supported only on ESX hosts.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMKernelV6GatewayDevice <String>

Specifies a VMKernel V6 gateway device. This parameter is supported only on ESX hosts.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,

the cmdlet runs without asking for user confirmation.



Required? false

Position? named

Default value $true

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more modified VMHostNetworkInfo objects







NOTES





If "DnsFromDhcp" is enabled "DomainName" and "HostName" cannot be explicitly set. To configure IPv6 settings,

you must be working on ESX 4.1 or later, and IPv6 must be enabled on the host system. The new IPv6 settings

take effect after the host is restarted.



-------------------------- Example 1 --------------------------



$vmHostNetworkInfo = Get-VmHostNetwork -Host Host



Set-VmHostNetwork -Network $vmHostNetworkInfo -VMKernelGateway 10.23.11.11 -DomainName eng.vmware.com -HostName

Host1 -DnsFromDhcp $false



Gets the network configuration of the virtual machine host named Host. Sets the virtual machine kernel gateway,

the domain name, the host name, and the Dhcp of the network.

-------------------------- Example 2 --------------------------



Get-VMHost Host | Get-VMHostNetwork | Set-VMHostNetwork -IPv6Enabled $true



Get-VMHost Host | Restart-VMHost -Force -Confirm:$false



Enables IPv6 support on the Host host and restarts the host.

-------------------------- Example 3 --------------------------



Get-VMHost Host | Get-VMHostNetwork | Set-VMHostNetwork -ConsoleV6Gateway $ipv6GatewayAddress

-ConsoleV6GatewayDevice "vswif0"



Configures the IPv6 console default gateway on the Host host.

-------------------------- Example 4 --------------------------



Get-VMHost Host | Get-VMHostNetwork | Set-VMHostNetwork -VMKernelV6Gateway $ipv6GatewayAddress



Configures the IPv6 VMKernel default gateway on the Host host.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... twork.html

Get-VMHostNetwork