Add-VMNetworkAdapterAcl(添加存取控制清單)

來源:互聯網
上載者:User

標籤: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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.