vSphere PowerCLI Reference

Set-VMHostFirewallDefaultPolicy

Synopsis

Sets the default policy for the specified host firewall.

Syntax

Set-VMHostFirewallDefaultPolicy [[-AllowIncoming] [<Boolean>]] [[-AllowOutgoing] [<Boolean>]] [-Policy] <VMHostFirewallDefaultPolicy[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMHostFirewallDefaultPolicy

Detailed Description

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 host version 5.0, you must provide the same value for the AllowIncoming and AllowOutgoing parameters.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
AllowIncomingBooleanIf the value of this parameter is $true, all incoming connections are allowed. If $false, they are disallowed.falsefalse
AllowOutgoingBooleanIf the value of this parameter is $true, all outcoming connections are allowed. If $false, they are disallowed.falsefalse
PolicyVMHostFirewallDefaultPolicy[]Specify a host firewall default policy you want to apply.truetrue (ByValue)
ConfirmSwitchParameterIf 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.falsefalse$true
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

VMHostFirewallDefaultPolicy

Notes

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


Copyright © 1998 - 2012 VMware, Inc. All rights reserved.