powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-VMHostNetwork



NAME
Set-VMHostNetwork

SYNOPSIS
Updates the specified virtual network.

SYNTAX
Set-VMHostNetwork [-Network] [-ConsoleGateway ] [-VMKernelGateway ] [-VMKerne
lGatewayDevice ] [-ConsoleGatewayDevice ] [-DomainName ] [-HostName ] [-DnsFromDhcp
[]] [-DnsDhcpDevice ] [-DnsAddress ] [-SearchDomain ] [-IPv6Enabled [ >]] [-ConsoleV6Gateway ] [-ConsoleV6GatewayDevice ] [-VMKernelV6Gateway ] [-VMKernelV6Gatew
ayDevice ] [-WhatIf] [-Confirm] []


DESCRIPTION
Updates the specified virtual network. The service console and the VMkernel are often not connected to the same net
work, 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
-Network
Specify the host network you want to configure.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-ConsoleGateway
Specify a new console gateway.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-VMKernelGateway
Specify a new kernel gateway.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-VMKernelGatewayDevice
Specify a new kernel gateway device.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ConsoleGatewayDevice
Specify a new console gateway device.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-DomainName
Specify a new domain name.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-HostName
Specify a new host name.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-DnsFromDhcp []
Indicate that you want to obtain the network settings from a Dhcp server.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-DnsDhcpDevice
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 ove
rride the system DNS. The parameter takes a ServiceConsoleNIC object, a VMKernelNIC object in case of an ESX vi
sor, or the NIC name as a string.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-DnsAddress
Specify a new DNS address.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-SearchDomain
Specify a new search domain.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-IPv6Enabled []
Indicate that IPv6 configuration is enabled. Setting this parameter to "false" disables the ConsoleV6Gateway, C
onsoleV6GatewayDevice, and VMKernelV6Gateway parameters. IPv6 is supported only on vCenter 4.0 and ESX 4.0 or h
igher. To use IPv6 on ESX, you must restart the host after enabling IPv6.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ConsoleV6Gateway
Specify a console V6 gateway address. Not supported on ESXi.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ConsoleV6GatewayDevice
Specify a console V6 gateway device. Not supported on ESXi.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-VMKernelV6Gateway
Specify a VMKernel V6 gateway address. This parameter is supported only on ESX hosts.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-VMKernelV6GatewayDevice
Specify a VMKernel V6 gateway device. This parameter is supported only on ESX hosts.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
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


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
VMHostNetworkInfo


NOTES


If "DnsFromDhcp" is enabled "DomainName" and "HostName" cannot be explicitly set.
To configure IPv6 settings, you must be working on ESX 4.0 or later, and IPv6 must be enabled on the host syste
m. The new IPv6 settings take effect after the host is restarted.

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

C:\PS>$vmHostNetworkInfo = Get-VmHostNetwork -Host Host

Set-VmHostNetwork -Network $vmHostNetworkInfo -VMKernelGateway 10.23.11.11 -DomainName eng.vmware.com -HostName Hos
t1 -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 --------------

C:\PS>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 --------------

C:\PS>Get-VMHost Host | Get-VMHostNetwork | Set-VMHostNetwork -ConsoleV6Gateway $ipv6GatewayAddress -ConsoleV6Gatew
ayDevice "vswif0"


Configures the IPv6 console default gateway on the Host host.





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

C:\PS>Get-VMHost Host | Get-VMHostNetwork | Set-VMHostNetwork -VMKernelV6Gateway $ipv6GatewayAddress


Configures the IPv6 VMKernel default gateway on the Host host.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-VMHostNetwork.html
Get-VMHostNetwork