VMware Cloud Community
lmonaco
Hot Shot
Hot Shot

Custom Firewall Rules

Anyone know if getting or setting custom firewall rules is available via PowerCLI yet?

Reply
0 Kudos
4 Replies
RvdNieuwendijk
Leadership
Leadership

PowercLI has four cmdlets for working with firewall rules:

Get-VMHostFirewallDefaultPolicy, Get-VMHostFirewallException, Set-VMHostFirewallDefaultPolicy and Set-VMHostFirewallException

I hope this is what you need.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
lmonaco
Hot Shot
Hot Shot

Yea, I knew about those, but I don't think you can get and set "custom" rules with those cmdlets.

Thanks for responding.

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership

You can use the SDK to do more with Firewall rules. E.g. to get the ruleset for host ESX1 you can do:

$VMHost = Get-VMHost ESX1
$FirewallSystem = Get-View $VMHost.ExtensionData.ConfigManager.FirewallSystem
$FirewallSystem.FirewallInfo.Ruleset

I hope this gives you an idea where to look.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
lmonaco
Hot Shot
Hot Shot

Didn't see the custom rules, but that was helpful for another task Smiley Happy

Reply
0 Kudos