vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 90 forks source link

How to modify a DFW rule #538

Closed jilanms closed 6 years ago

jilanms commented 6 years ago

Hi, I've been playing around with PowerNSX and created a basic VM to VM rule which denies traffic on any service. But what if I want to modify the service and change the action to allow? So for example I want to allow port 80 traffic. I know first I would have to create a variable which I have done: $svc1 = New-NsxService -name svc1 -Protocol TCP -port 80 Then call my DFW section/rule using: Get-NsxFirewallSection TestSection | Get-NsxFirewallRule "testrule" | After that 2nd pipe is where I get stuck and not sure how to set the service and change the action to allow.

Thanks

alagoutte commented 6 years ago

Hi Jilanms

You have found how to modify your DFW rule ? No sure it is yet possible to modify a service...

For Action (Allow/Deny), you can use/look #506 (set-nsxfirewallrule cmdlet)