標籤:des style http color 使用 os strong io
Add-VMNetworkAdapterAcl
Creates an ACL to apply to the traffic through a virtual machine network adapter.
Example 1
This example adds an ACL to allow virtual machine Redmond to send to and receive from traffic on IP subnet 10.0.0.8/8.
PS C:\> Add-VMNetworkAdapterAcl –VMName Redmond –RemoteIPAddress 10.0.0.0/8 –Direction Both –Action Allow
Example 2
This example adds an ACL to deny virtual machine Redmond to send either IPv4 or IPv6 traffic to anywhere and receive such traffic from anywhere.
PS C:\> Add-VMNetworkAdapterAcl –VMName Redmond –RemoteIPAddress ANY –Direction Both –Action Deny
Example 3
This example gets virtual machine Redmond and adds an ACL to deny it to send any traffic to a device with MAC address 03-0f-01-0e-aa-b2 or to receive any traffic from that device.
PS C:\> Get-VM Redmond | Add-VMNetworkAdapterAcl -RemoteMacAddress 03-0f-01-0e-aa-b2 -Direction Both -Action Deny
Example 4
This example gets virtual network adapters from virtual machine Redmond and adds an ACL to meter outgoing traffic sent to IP subnet 192.168.0.0/16.
PS C:\> Get-VMNetworkAdapter -VMName Redmond | Add-VMNetworkAdapterAcl -RemoteIPAddress 192.168.0.0/16 -Direction Outbound -Action Meter
From:http://technet.microsoft.com/zh-cn/library/hh848505.aspx
Add-VMNetworkAdapterExtendedAcl
Windows Server® 2012 R2 中用於 Hyper-V 虛擬交換器的新增功能之一是擴充座存取控制清單 (ACL)。你可以在 Hyper-V 虛擬交換器上配置擴充 ACL,以允許和阻止傳往及傳自通過虛擬網路介面卡串連到交換器的虛擬機器 (VM) 的網路流量。
建立規則時,可以使用 –Weight 參數來確定 Hyper-V 虛擬交換器處理規則的順序。–Weight 的值以整數表示;先處理整數較大的規則,再處理整數較小的規則。例如,如果你向 VM 網路介面卡應用了兩個規則,其中一個規則的權重為 1,另一個規則的權重為 10,則先應用權重為 10 的規則。
下面兩個樣本說明了如何使用 Windows PowerShell 命令建立規則。第一個樣本規則將阻止傳往名為“ApplicationServer”的 VM 的所有流量。第二個樣本規則將應用到名為“ApplicationServer”的 VM 的網路介面卡,該規則只允許該 VM 的入站 RDP 流量。
Add-VMNetworkAdapterExtendedAcl –VMName “ApplicationServer” –Action “Deny” –Direction “Inbound” –Weight 1Add-VMNetworkAdapterExtendedAcl –VMName “ApplicationServer” –Action “Allow” –Direction “Inbound” –LocalPort 3389 –Protocol “TCP” –Weight 10
From:http://technet.microsoft.com/zh-cn/library/dn375962.aspx#bkmk_detailed