Syntax
Set-VMHostFirewallDefaultPolicy [[-AllowIncoming] <Boolean>] [[-AllowOutgoing] <Boolean>] [-Policy] <VMHostFirewallDefaultPolicy[]> [-WhatIf] [-Confirm] [<CommonParameters>]Related Commands
Online versionDetailed Description
This cmdlet sets the default policy for the specified host firewall. This policy specifies whether outgoing or incoming connections are allowed. At least one of the AllowIncoming and AllowOutgoing parameters must be set. When you configure the default firewall policy of an ESX/ESXi host version 5.0, you must provide the same value for the AllowIncoming and AllowOutgoing parameters.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
AllowIncoming | Boolean | If the value of this parameter is $true, all incoming connections are allowed. If the value is $false, all incoming connections are disallowed. | false | false | |
AllowOutgoing | Boolean | If the value of this parameter is $true, all outcoming connections are allowed. If the value is $false, all outcoming connections are disallowed. | false | false | |
Policy | VMHostFirewallDefaultPolicy[] | Specifies the host firewall default policy you want to apply. | true | true (ByValue) | |
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. | false | false | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false |
Return Type
Zero or more VMHostFirewallDefaultPolicy objectsNotes
Firewall management functionality is not supported on ESX 3i.Examples
-------------- Example 1 --------------
$firewallpolicy = Get-VMHostFirewallDefaultPolicy -VMHost 10.23.123.100 Set-VMHostFirewallDefaultPolicy -Policy $firewallpolicy -AllowOutGoing $true | fl
Changes the default firewall policy of the virtual machine host with IP address 10.23.123.100, so that the outgoing connections are allowed.
VMHostId : HostSystem-host-8
IncomingEnabled : False
OutgoingEnabled : True
Client : VMware.VimAutomation.Client20.VimClient