日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Windows Server 2012&R2超級虛擬化之十 軟件定義網(wǎng)絡之虛擬交換機

 Lavande21 2019-08-06

                                 Windows Server 2012&R2超級虛擬化之十軟件定義網(wǎng)絡之虛擬交換機

  Hyper-V虛擬交換機是基于軟件的第 2層網(wǎng)絡交換機,它維護了一個MAC表,包含連接到它的所有虛擬機的MAC地址,主機內(nèi)的所有虛擬機都要通過虛擬交換機才能與物理網(wǎng)絡或內(nèi)部網(wǎng)絡通信。在Hyper-V中創(chuàng)建虛擬交換機時有三種類型的選擇:外部,私人和內(nèi)部。

外部虛擬網(wǎng)(Bridge)絡。在允許虛擬機與外部服務器和管理操作系統(tǒng)(有時稱為父分區(qū))進行通信時,可以使用此類型的虛擬網(wǎng)絡。此類型的虛擬網(wǎng)絡還允許位于同一物理服務器上的虛擬機互相通信。當您安裝 Hyper-V 并創(chuàng)建外部虛擬網(wǎng)絡時,管理操作系統(tǒng)將使用一個新的虛擬網(wǎng)絡適配器來連接物理網(wǎng)絡。網(wǎng)絡連接由原始網(wǎng)絡適配器和新的虛擬網(wǎng)絡適配器組成。原始物理網(wǎng)絡適配器未綁定任何協(xié)議和服務。不過,虛擬網(wǎng)絡適配器綁定了所有的標準協(xié)議和服務。創(chuàng)建外部虛擬網(wǎng)絡時,Hyper-V會將虛擬網(wǎng)絡服務協(xié)議綁定到物理網(wǎng)絡適配器。您應該知道,在創(chuàng)建或刪除外部虛擬網(wǎng)絡時,將會暫時中斷外部網(wǎng)絡連接。創(chuàng)建外部虛擬網(wǎng)絡后,除了交換機是基于軟件以及可以根據(jù)需要動態(tài)添加或刪除端口之外,虛擬網(wǎng)絡與物理網(wǎng)絡的工作原理基本相同。一旦配置了外部虛擬網(wǎng)絡,所有的網(wǎng)絡通信都將通過虛擬交換機傳送。因此,建議使用至少一個其他物理網(wǎng)絡適配器來管理網(wǎng)絡通信。虛擬交換機發(fā)揮物理交換機的功能,通過虛擬網(wǎng)絡將網(wǎng)絡通信傳送到其目的地

內(nèi)部虛擬網(wǎng)絡(NAT。在只允許同一物理服務器上的虛擬機與虛擬機、虛擬機與管理操作系統(tǒng)之間進行通信時,可以使用此類型的虛擬網(wǎng)絡。內(nèi)部虛擬網(wǎng)絡是一種未綁定到物理網(wǎng)絡適配器的虛擬網(wǎng)絡。它通常用來構建從管理操作系統(tǒng)連接到虛擬機所需的測試環(huán)境

專用虛擬網(wǎng)絡(Private。在只允許同一物理服務器上的虛擬機之間進行通信時,可以使用此類型的虛擬網(wǎng)絡。專用虛擬網(wǎng)絡是一種無需在管理操作系統(tǒng)中裝有虛擬網(wǎng)絡適配器的虛擬網(wǎng)絡。在希望將虛擬機從管理操作系統(tǒng)以及外部網(wǎng)絡中的網(wǎng)絡通信中分離出來時,通常會使用專用虛擬網(wǎng)絡

Hyper-V中,允許您配置復雜的虛擬網(wǎng)絡環(huán)境,但虛擬網(wǎng)絡的基本概念卻是非常簡單。對于簡單的虛擬網(wǎng)絡配置,建議在運行 Hyper-V的服務器上至少配置兩個網(wǎng)絡適配器:一個網(wǎng)絡適配器專供進行遠程管理的物理計算機使用,另外一個或多個網(wǎng)絡適配器專門用于虛擬機。如果您為虛擬硬盤存儲運行 Internet SCSI (iSCSI)發(fā)起程序,建議您使用管理操作系統(tǒng)中的其他網(wǎng)絡適配器。管理操作系統(tǒng)是一個分區(qū),它調(diào)用 Windows虛擬機監(jiān)控程序并請求創(chuàng)建新的分區(qū)。只能存在一個管理操作系統(tǒng)。當創(chuàng)建虛擬機并將其連接到虛擬網(wǎng)絡時,它將會使用虛擬網(wǎng)絡適配器進行連接。有兩種類型的網(wǎng)絡適配器可用于 Hyper-V:網(wǎng)絡適配器和舊版網(wǎng)絡適配器。為了使網(wǎng)絡適配器能夠正常工作,必須安裝集成服務,該服務是 Hyper-V 安裝的一部分。如果集成服務因為操作系統(tǒng)的版本而無法安裝,將無法使用網(wǎng)絡適配器。您需要添加一個舊版網(wǎng)絡適配器,用于模擬基于 Intel 21140 PCI快速以太網(wǎng)適配器,并在無需安裝虛擬機驅動程序的情況下工作。舊版網(wǎng)絡適配器還支持基于網(wǎng)絡的安裝,因為它具有啟動到預啟動執(zhí)行環(huán)境 (PXE)的能力。如果虛擬機需要從網(wǎng)絡啟動,也需要舊版網(wǎng)絡適配器。啟動到 PXE之后,您需要禁用網(wǎng)絡適配器。虛擬機在邏輯上連接到虛擬網(wǎng)絡上的一個端口。為了使虛擬機上的網(wǎng)絡應用程序能夠從外部連接到某個事物,它首先會通過虛擬網(wǎng)絡適配器路由到外部虛擬網(wǎng)絡上的虛擬端口(連接虛擬機的端口)。然后將網(wǎng)絡數(shù)據(jù)包定向到物理網(wǎng)絡適配器并向外發(fā)送到外部物理網(wǎng)絡。為了使虛擬機能夠與管理操作系統(tǒng)進行通信,有兩個選項可供選擇。一個選項是將網(wǎng)絡數(shù)據(jù)包通過物理網(wǎng)絡適配器向外路由到物理網(wǎng)絡,這種方法之后會使用第二個物理網(wǎng)絡適配器將數(shù)據(jù)包返回給運行 Hyper-V 的服務器。另一個選項是通過虛擬網(wǎng)絡路由網(wǎng)絡數(shù)據(jù)包,這種方法更高效。選擇哪個選項由虛擬網(wǎng)絡決定。虛擬網(wǎng)絡包含一種學習算法,該算法決定將通信定向到的最有效的端口,并將網(wǎng)絡數(shù)據(jù)包發(fā)送到該端口。虛擬網(wǎng)絡作出決定后,網(wǎng)絡數(shù)據(jù)包將會被發(fā)送到所有的虛擬端口。

Hyper-V的內(nèi)部網(wǎng)絡虛擬交換機和外部網(wǎng)絡虛擬交換機支持VLAN配置,而私有的虛擬交換機默認為vlantrunk模式無需要配置。對于每個虛擬機的虛擬網(wǎng)絡適配器,您還可以配置一個 VLAN ID。虛擬交換機可以使用兩種模式來配置 VLAN:訪問模式和 trunk 模式。在訪問模式中,虛擬網(wǎng)絡的外部端口被限制為指定的一個 VLAN ID (1-4094)。當物理網(wǎng)絡適配器連接到物理網(wǎng)絡交換機上的某個端口也處于訪問模式中時,請使用訪問模式。若要使虛擬機能夠訪問外部處于訪問模式下的虛擬網(wǎng)絡,您必須將虛擬機配置為使用與在虛擬網(wǎng)絡的訪問模式中配置的相同 VLAN ID。在中繼模式下,虛擬交換機會聽所有的網(wǎng)絡流量,將流量的所有端口。換句話說,網(wǎng)絡數(shù)據(jù)包被發(fā)送到所有的虛擬機連接到它。默認情況下,在Hyper-V虛擬交換機被配置為Trunk模式,這意味著虛擬交換機接收所有網(wǎng)絡數(shù)據(jù)包并將其轉發(fā)給所有的虛擬機連接到它。沒有太多需要配置Trunk模式中的虛擬交換機的配置。Trunk模式允許多個 VLAN ID共享物理網(wǎng)絡適配器和物理網(wǎng)絡之間的連接。若要使虛擬機能夠外部訪問多個 VLAN中的虛擬網(wǎng)絡,您需要將物理網(wǎng)絡上的端口配置為 trunk模式。還需要知道所使用的特定 VLAN,以及虛擬網(wǎng)絡支持的虛擬機使用的所有 VLAN ID.

  Windows Server? 2012中的 Hyper-V虛擬交換機引入了一些新功能和增強能力,用于多租戶隔離、流量整形、惡意虛擬機防護、以及簡化的故障排除。利用內(nèi)置的網(wǎng)絡設備接口規(guī)范 (NDIS)篩選篩選器驅動程序以及 Windows篩選平臺 (WFP)標注驅動程序支持,Hyper-V 虛擬交換機使獨立軟件供應商 (ISV)可以創(chuàng)建可擴展的插件(稱為虛擬交換機擴展)以提供增強的網(wǎng)絡和安全能力。在Windows server 2012中虛擬交換機變成了可擴張的虛擬交換機,它增強的功能有:

1、Windows PowerShell commands for Hyper-V Virtual Switch

You can now use WindowsPowerShell commands, run manually or in scripts, to configure Hyper-V VirtualSwitch and related features.

VMNetworkAdapter

VMNetworkAdapterAcl

VMNetworkAdapterVlan

VMSwitch

2、Multiple Virtual NICs

In previous versions ofHyper-V, only one parent virtual NIC was supported, however in Windows Server2012 Hyper-V, multiple NICs are supported. In addition, you can share thephysical NIC that is bound to the Hyper-V Switch with the management operatingsystem. You can create multiple parent virtual NICS that you use for livemigration, storage, and management; and you can assign each virtual NIC to adifferent virtual Local Area Network (VLAN). You can also create differentQuality of Service (QoS) polices for each virtual NIC.

 Add-VMNetworkAdapter ManagementOS Name Management

Add-VMNetworkAdapterManagementOSName Storage

Add-VMNetworkAdapterManagementOSNameLive Migration

3Port Access Control Lists (ACLs)

A port ACL is a rulethat you can apply to a Hyper-V switch port. The rule specifies whether apacket is allowed or denied on the way into or out of the VM. ACLs have threeelements with the following structure:Local or Remote Address | Direction |Action.You can specifyeither a local address or a remote address inLocal or Remote Address,but you cannot specify both. The value that you supply forLocal or RemoteAddress can be an IPv4 address, an IPv6 address, or a media access control(MAC) address. Optionally you can use an IP address range if you provide therange prefix.You can configure multiple port ACLs for a Hyper-V switch port.During operations, the port ACL whose rules match the incoming or outgoingpacket is used to determine whether the packet is allowed or denied.

Add-VMNetworkAdapterAcl -VMName MyVMLocalMacAddress 12-34-56-78-9A-Direction Both Action Allow

Add-VMNetworkAdapterAcl -VMName MyVMLocalMacAddressFF-FF-FF-FF-FF-FF Direction InBoundActionAllowAdd-VMNetworkAdapterAcl -VMNameMyVMLocalMacAddressAny Direction BothAction DenyAdd-VMNetworkAdapterAclVMName MyVM RemoteIPAddress 192.168.0.0/16Direction OutboundAction Meter

4、MacAddressSpoofing

MacAddressSpoofingallows you to specify whether a VM is allowed to change its source MAC addressfor outgoing packets.

  1. Set-VMNetworkAdapter VMName MyVMMacAddressSpoofing On

  2. Set-VMNetworkAdapter VMName MyVMMacAddressSpoofing Off

5、RouterGuard

RouterGuard allows youto specify whether the router advertisement and redirection messages fromunauthorized VMs should be dropped

  1. Set-VMNetworkAdapter VMName MyVMRouterGuard Off

  2. Set-VMNetworkAdapterVMName MyVMRouterGuard On

6、DHCPGuard

DHCPGuard allows you tospecify whether DHCP server messages coming from a VM should be dropped.

  1. Set-VMNetworkAdapter VMName MyDhcpServer1DhcpGuard Off

  2. Set-VMNetworkAdapter VMName CustomerVMDhcpGuard On

7、Port Virtual Local Area Network(PVLAN)

Network isolation isrelated to security, but unlike IPsec - which encrypts the network traffic -isolation logically segments the traffic. VLANs, however, suffer scalabilityissues. A VLAN ID is a 12-bit number, and VLANs are in the range 1-4095. In amulti-tenant data center, if you want to isolate each tenant by using a VLAN,configuration is complex and difficult. These scalability issues of VLANs aresolved when you deploy Hyper-V Network Virtualization, where tenants each havemultiple virtual subnets. However, a simple solution when each tenant only hasa single VM is to use PVLAN.PVLAN addresses some of the scalability issues ofVLANs. PVLAN is a switch port property. With PVLAN there are two VLAN IDs, aprimary VLAN ID and a secondary VLAN ID. A PVLAN may be in one of three modes.

  1. IsolatedCommunicates only with Promiscuous ports inthe PVLAN

  2. PromiscuousCommunicates with all ports in the PVLAN

  3. Community Communicates with ports in thesame community and any promiscuous ports in the PVLAN

PVLAN can be used to create anenvironment where VMs may only interact with the Internet and not havevisibility into other VMs network traffic. To accomplish this put all VMs(actually their Hyper-V switch ports) into the same PVLAN in isolated mode.Therefore, using only two VLAN IDs, primary and secondary, all VMs are isolatedfrom each other. The following PowerShell script puts a VMs switch port into PVLANisolated mode

8、Trunk Mode

In addition to PVLAN, Hyper-V Virtual Switch also provides support for VLANtrunk mode. Trunk mode provides network services or network appliances on a VMwith the ability to see traffic from multiple VLANs.In trunk mode, a switchport receives traffic from all VLANs that you configure in an allowed VLANlist. You can also configure a switch port that is connected to a VM - but isnot bound to the underlying NIC - for trunk mode .In the following examplecmdlet, MyVM can send or receive traffic on any VLAN in the allowed list. Ifthere is no VLAN specified in the packet, the packet is treated as if it isfrom VLAN 10.

Set-VMNetworkAdapterVlanVMName MyVMTrunkAllowedVlanIdList1-100NativeVlanId 10

9、Port Mirroring

With Port Mirroring, traffic sent to or from a Hyper-V Virtual Switch portis copied and sent to a mirror port. There are a range of applications for portmirroring - an entire ecosystem of network visibility companies exist that haveproducts designed to consume port mirror data for performance management,security analysis, and network diagnostics. With Hyper-V Virtual Switch portmirroring, you can select the switch ports that are monitored as well as theswitch port that receives copies of all the traffic.The followingexamples configure port mirroring so that all traffic that is sent and receivedby both MyVM and MyVM2 is also sent to the VM named MonitorVM.

Set-VMNetworkAdapterVMName MyVM PortMirroring Source

Set-VMNetworkAdapterVMName MonitorVM PortMirroring Destination

10、IPsec Task Offload(IpsecTO)

Many encryptionalgorithms are processor-intensive, which can slow the performance of VMs.Hyper-V Virtual Switch now provides VMs with the ability to use IPsecTO, whichallows the VM to offload encryption processes to the NIC. Offloading theper-packet encryption operations from the VM to the NIC results in substantialCPU savings.

Set-VMNetworkAdapterVMName MyVM -IPsecOffloadMaximumSecurityAssociation200

IPsec includes aSecurity Association (SA) with which it performs encryption, and when youenable IPsecTO, the VM offloads the SA to the NIC for processing.IPsecTO-capable NICs have a limited number of SAs that can be offloaded, so youcan use Windows PowerShell to designate the number of SAs that the VM canoffload to the NIC. Following are the requirements for using IPsecTO.

  1. Only VMs runningWindows Server(R) 2008 R2 and Windows Server 2012 are supported,because the VMs network stack must support IPsecTO.

  2. The physical NIC must also support IPsecTO.

11、Receive Side Scaling (RSS) andDynamic Virtual Machine Queue (dVMQ)

In networking it is important to resolve circumstances where networktraffic is blocked or slowed down, thereby causing latency. For native traffic,Receive Side Scaling (RSS) processes incoming network traffic so that it isnt sloweddown by a single CPU. RSS processes the IP source and destination fields andTCP source and destination ports to spread the receive traffic across multipleCPU cores. For receive network traffic coming externally from the server andinto the Hyper-V Virtual Switch, Dynamic Virtual Machine Queue (dVMQ) performsa function similar to RSS. With dVMQ, the destination MAC address is hashed toput the traffic destined for a virtual NIC into a specific queue. Theinterrupts to the CPU cores are also distributed to avoid being slowed by asingle CPU core. If your VMs on a Hyper-V Virtual Switch receive a lot ofexternal network traffic, its a good idea to use dVMQ.dVMQ alsoincludes dynamic load balancing. Previously, the MAC hashing was donestatically, and it was difficult to manage dVMQ. Management of dVMQ is nowsimple it is enabled by default, and no other management steps are required .If for some reason youhavedisabled dVMQ, you can enable it again by using the following cmdlet. The NICin this example is a physical NIC that is bound to the virtual switch, and itis named GuestTrafficNic.

Enable-NetAdapterVmqGuestTrafficNic

12、Hyper-vQuality of Service (QoS)

QoS is a set of technologies for managing networktraffic in a cost effective manner, to enhance user experiences in enterpriseenvironments, as also in home and small offices. QoS technologies allow you tomeasure bandwidth, detect changing network conditions (such as congestion oravailability of bandwidth), and prioritize or throttle traffic. For example,you can use QoS to prioritize traffic for latency-sensitive applications (suchas voice or video), and to control the impact of latency-insensitive traffic(such as bulk data transfers)。You can use Hyper-V QoS to manage network traffic on the virtualnetwork. In Windows Server? 2012, QoS includes new bandwidth managementfeatures that enable cloud hosting providers and enterprises to provideservices that deliver predictable network performance to virtual machines on aserver that is running the Hyper-V server role. Hyper-V QoS supports themanagement of upper-allowed and lower-allowed bandwidth limits, commonlyreferred to as maximum bandwidth and minimum bandwidth.

In hosted environments, Hyper-V QoS enables you toguarantee specific performance levels based on the service level agreements(SLAs) to which you have agreed with your customers. Hyper-V QoS helps ensurethat your customers are not impacted or compromised by other customers on theirshared infrastructure, which can include computing, storage, and networkresources.

In addition, enterprise networks might requiresimilar functionality. By using Hyper-V QoS in your enterprise, you can runmultiple virtual machine-based application servers on a host server that isrunning Hyper-V, and have confidence that each application server deliverspredictable performance.

Hyper-V QoS provides the ability to:

Enforce minimum bandwidth and maximum bandwidth for atraffic flow, which is identified by a Hyper-V Virtual Switch port number.

Configure minimum bandwidth and maximum bandwidth perHyper-V virtual switch port by using either PowerShell cmdlets or WindowsManagement Instrumentation (WMI).

Configure multiple virtual network adapters inHyper-V and specify QoS on each virtual network adapter individually.

enforce QoS policies on Single Root I/OVirtualization (SR-IOV)-capable network adapters that support bandwidthreservation per Virtual Port

Windows Server 2012 Hyper-V QoS can also use hardwarethat is compatible with data center bridging (DCB) to converge multiple typesof network traffic on a single network adapter with a guaranteed level ofservice provided to each type of traffic. With Windows PowerShell, you canconfigure these new features manually or enable automation in a script tomanage a group of servers, regardless of whether they are joined to a domain.

13、Hyper-v SR-IOV

  在虛擬機管理程序虛擬化的早期,英特爾和AMD認識到:如果它們把某些功能從軟件卸載到處理器本身上面,就有助于提供更好的性能。這項機制現(xiàn)在分別被稱為Intel-VTAMD-V,也是大多數(shù)現(xiàn)代虛擬機管理程序的一項要求。SR-IOV同樣將網(wǎng)絡功能從軟件轉移到硬件上,以提高性能和靈活性。如果你有一臺BIOS里面支持SR-IOV的服務器,又有能夠支持SR-IOV的網(wǎng)卡,該服務器就能向虛擬機提供虛擬功能(Virtual Functions——實際上這些就是服務器本身的虛擬副本。如果你想廣泛使用SR-IOV,就要明白如今支持它的網(wǎng)卡在它們所提供的虛擬功能數(shù)量方面很有限;有些網(wǎng)卡每塊只支持4項虛擬功能,有些支持32項,有些最多支持64項。

  并不是因帶寬而需要SR-IOV,因為只有萬兆以太網(wǎng)連接才能被Hyper-V虛擬機總線塞滿,但是它占用大約一個處理器核心用于計算。所以,如果你要求處理器的使用率很低,那么SR-IOV是最穩(wěn)妥的選擇。如果延遲時間極其重要,SR-IOV為你提供了近似本地裸機的網(wǎng)絡性能,所以那是SR-IOV大放異彩的另一個場景。

  它有特定的應用和局限性,你在規(guī)劃部署新的Hyper-V集群時需要注意。如果你使用Hyper-V可擴展交換機,又配置了端口的訪問控制列表(ACL),可能還配置了一個或多個擴展,這些都會因SR-IOV而被繞過,因為交換機從來看不到SR-IOV流量。你也無法聚合主機上多塊支持SR-IOV的網(wǎng)卡;不過,你可以在主機上有兩塊(或更塊)物理SR-IOV網(wǎng)卡,把這些網(wǎng)卡提供給虛擬機;而且可以在虛擬機里面,利用虛擬網(wǎng)卡組建一個網(wǎng)卡群,以提升性能和故障切換機制。

SR-IOV的確可與實時遷移(Live Migration)協(xié)同使用,這是VMwarevSphere 5.1所做不到的。在每項虛擬功能的后臺,Hyper-V利用平常的虛擬機總線網(wǎng)卡組建輕型網(wǎng)卡群;如果你把虛擬機實時遷移到?jīng)]有SR-IOV網(wǎng)卡的主機,它只是切換到軟件網(wǎng)卡。

SR-IOV 是一種通過提供 I/O 所需的直接硬件路徑,使得 PCI Express設備能夠在多個虛擬機之間進行共享的標準。Hyper-V能夠支持符合 SR-IOV標準的網(wǎng)絡適配器。SR-IOV 可降低網(wǎng)絡延遲,降低處理網(wǎng)絡通訊時的 CPU占用率,并可提升網(wǎng)絡吞吐率。符合 SR-IOV標準的網(wǎng)絡設備具有一種名為 Virtual Functions 的硬件界面,可通過安全的方式將其分配給虛擬機—并繞過管理用操作系統(tǒng)中的虛擬交換機,直接收發(fā)數(shù)據(jù)。策略與控制則依然由管理用操作系統(tǒng)實施。SR-IOV完全兼容實時遷移功能,因為基于硬件的網(wǎng)絡在任何時間都可用。在實時遷移過程中,VirtualFunctions會被暫時刪除。這樣實時遷移即可使用不同供應商的網(wǎng)絡適配器,或在目標計算機上 SR-IOV不可用的情況下使用。實現(xiàn)條件:

一個IOMMU(input/outputmemory management unit)設備系統(tǒng)的硬件支持

一個PCIExpress網(wǎng)絡設備,其中有SR-IOV的能力驅動程序模型,同時支持PFVFS。

Windows Server 2012 R2Hyper-V可擴展的虛擬交換機的又有了更強的功能:

1、企業(yè)和云服務提供商 (CSP)可以配置 Hyper-V虛擬交換機擴展端口訪問控制列表 (ACL),以提供防火墻保護,并為數(shù)據(jù)中心的租戶 VM實施安全策略。由于端口 ACL是在 Hyper-V虛擬交換機上而非 VM內(nèi)部配置的,因此你可以管理多租戶環(huán)境中所有租戶的安全策略。

  1. ACL 現(xiàn)在包括套接字端口號。在 Windows Server 2012中,可為 IPv4 IPv6指定源與目標 MAC地址和 IP地址。對于 Windows Server 2012R2,在創(chuàng)建規(guī)則時,還可以指定端口號。

  2. 現(xiàn)在,你可以配置單向的有狀態(tài)規(guī)則,并提供超時參數(shù)。使用有狀態(tài)防火墻規(guī)則可以允許流量,并且動態(tài)創(chuàng)建兩個通信流。在這兩個通信流中,有一個是出站規(guī)則,它與出站數(shù)據(jù)包中的五個特性匹配;另一個是入站規(guī)則,它也與相同的五個特性匹配。成功使用有狀態(tài)規(guī)則一次以后,將允許這兩個通信流,并且在你使用超時特性指定的時間段內(nèi),不再需要根據(jù)規(guī)則查找這些通信流。當防火墻規(guī)則超出超時特性時,將再次根據(jù)規(guī)則檢查通信流。

  3. 在多租戶環(huán)境中,你可以保護數(shù)據(jù)中心資源,并為租戶提供安全策略實施。

  4. Hyper-V網(wǎng)絡虛擬化兼容。

  5. 提供管理界面,讓你使用 Windows PowerShell輕松配置防火墻規(guī)則。

  6. 提供日志記錄和診斷功能,使你能夠確認防火墻操作,并檢測端口 ACL的任何可能的不當配置。

  7. 當您創(chuàng)建規(guī)則,您可以使用-weight參數(shù),以確定其中的Hyper-V虛擬交換機處理規(guī)則的順序。Weight的值表示為整數(shù),具有較高整數(shù)的規(guī)則比低的整數(shù)規(guī)則優(yōu)先處理。例如,如果你已經(jīng)應用了兩個規(guī)則,一個weight值為1,一個weight10,那么10的規(guī)則將優(yōu)先處理。

  8. 可配置為無狀態(tài)防火墻,只需根據(jù)數(shù)據(jù)包中的五個特性來篩選數(shù)據(jù)包即可;使用無狀態(tài)防火墻配置,可以將任何防火墻規(guī)則應用到入站或出站網(wǎng)絡流量,并且該規(guī)則可以允許或拒絕流量。

2、網(wǎng)絡流量的動態(tài)負載平衡NIC Teaming

  NIC組合就是把同一臺服務器上的多個物理網(wǎng)卡通過軟件綁定成一個虛擬的網(wǎng)卡,也就是說,對于外部網(wǎng)絡而言,這臺服務器只有一個可見的網(wǎng)卡。對于任何應用程序,以及本服務器所在的網(wǎng)絡,這臺服務器只有一個網(wǎng)絡鏈接或者說只有一個可以訪問的IP地址。之所以要利用NIC組合技術,除了利用多網(wǎng)卡同時工作來提高網(wǎng)絡速度以外,還有可以通過NIC組合實現(xiàn)不同網(wǎng)卡之間的負載均衡(Load balancing)和網(wǎng)卡冗余(Fault tolerance)。

 微軟NIC組合也稱為負載平衡和故障轉移(LBFO),NIC組合要求提供一個以太網(wǎng)網(wǎng)絡適配器,該適配器可以用于分離使用VLAN的流量。通過故障轉移提供故障保護的所有模式都至少需要兩個以太網(wǎng)網(wǎng)絡適配器。它應用于Windows Server 2012的所有版本中,包括核心版和圖形界面完全版;NIC組合在 Windows 8中是不可用的。WindowsServer 2012實現(xiàn)在一個組中可支持多達 32NIC。它允許出于以下目的將一臺計算機上的多個網(wǎng)絡適配器放置到一個小組中

  1. 帶寬聚合

  2. 進行流量故障轉移,以防止在網(wǎng)絡組件發(fā)生故障時失去連接

下面是基本的用于 NIC組合的算法,這兩種模式都會導致入站和出站流量接近聚合帶寬的實際限制,原因是組中的鏈路池相當于一個管道:

1、靜態(tài)成組(IEEE 802.3ad draft v1):此模式配置交換機和主機之間需要哪種鏈接組合形式,由于這是一個靜態(tài)配置的解決方案沒有任何附加協(xié)議,所以就不會因為交換機或主機因為電纜的插入錯誤或其它錯誤而導致組合的形成。此種模式中,網(wǎng)卡,可以工作于不同的速度,就是說可以用不通速度的網(wǎng)卡建立組合,但同樣要求交換機完全支持IEEE 802.3ad 標準,一般情況下,服務器級別的交換機通常支持此模式。屬于依賴于交換機的模式。這種算法需要組中的所有網(wǎng)絡適配器都連接到相同的交換機。

2、交換機獨立:這是配置時的默認值,此模式不要求交換機參與組合配置,由于獨立模式下的交換機不知道網(wǎng)卡是主機上組合的一部分,網(wǎng)卡可以連接到不同的交換機。屬于獨立于交換機的模式

3LACP動態(tài)組合(IEEE 802.1ax, LACP)LACP動態(tài)組合是到同一臺交換機的鏈路聚合,只不過不是靜態(tài)配置的,而是動態(tài)構成(也就是自動協(xié)商)的。它是通過一種智能的鏈路協(xié)商協(xié)議LACP (Link Aggregation Control Protocol)來實現(xiàn)的。LACP原本用于交換機和交換機之間的鏈路聚合,啟用了LACP協(xié)議的2臺交換機會相互發(fā)送LACP的協(xié)商報文,當發(fā)現(xiàn)2者之間有多條可用的鏈路的時候,自動將這些鏈路組合成一條帶寬更大的邏輯鏈路,從而利用負載均衡來實現(xiàn)加寬交換機間鏈路帶寬的目的。屬于依賴于交換機的模式。這種算法需要組中的所有網(wǎng)絡適配器都連接到相同的交換機。

Windows Server 2012中的 NIC組合支持以下流量分發(fā)方法:

Hyper-V交換機端口。當虛擬機具有獨立的媒體訪問控制 (MAC)地址時,虛擬機的 MAC地址可以為劃分流量提供基礎。在虛擬化中使用這種方案具有優(yōu)勢。因為相鄰的交換機可以確定特定源 MAC地址位于唯一一個連接的網(wǎng)絡適配器上,交換機將根據(jù)虛擬機的目標 MAC地址在多個鏈路上平衡外出負載(從交換機到計算機的流量)。當與虛擬機隊列一起使用時該方案非常有用。但是,這種模式可能不夠具體,因而無法獲得較為平衡的分發(fā),并且它將單個虛擬機限制為單個網(wǎng)絡適配器上可用的帶寬。Windows Server 2012 使用 Hyper-V交換機端口作為標識符,而不是源 MAC地址,因為在某些情況下,一個虛擬機可能使用交換機端口上的多個 MAC地址

哈希。該算法根據(jù)數(shù)據(jù)包的組件創(chuàng)建哈希,然后將具有該哈希值的數(shù)據(jù)包分配給可用的網(wǎng)絡適配器之一。這樣便在相同的網(wǎng)絡適配器上保留來自相同 TCP 流的所有數(shù)據(jù)包。通常,哈希只是在可用的網(wǎng)絡適配器之間創(chuàng)建平衡。市場上提供的某些 NIC組合解決方案監(jiān)視流量的分發(fā),并且它們將特定的哈希值重新分配給不同的網(wǎng)絡適配器,以嘗試更好地平衡流量。動態(tài)重新分發(fā)稱為智能負載平衡自適應負載平衡。

可以用作哈希函數(shù)輸入的組件包括:

源和目標 MAC地址

源和目標 IP地址,考慮或不考慮 MAC地址(2 元組哈希)

源和目標 TCP端口,通常與 IP地址一起使用(4 元組哈希)

4元哈??梢愿毜胤职l(fā)通信流,從而使能夠在網(wǎng)絡適配器之間獨立移動的流更小。但是,它不可以用于非 TCP 的流量或 UDP流量或從堆棧中隱藏 TCP UDP端口的流量,如受 Internet協(xié)議安全 (IPsec)保護的流量。在這些情況下,哈?;赝说?/span> 2元組哈希。如果該流量不是 IP流量,哈希生成器將會使用源和目標 MAC地址。

NICTeam備用適配器:可以讓其中的一個網(wǎng)卡當備用網(wǎng)卡;也可以讓所有網(wǎng)卡都處于活動狀態(tài)。

NIC Team也適合于虛擬機。它允許虛擬機具有連接到多個 Hyper-V 交換機的虛擬網(wǎng)絡適配器并且即使該交換機下的網(wǎng)絡適配器斷開連接,也仍然能夠連接。當使用諸如單根 I/O虛擬化 (SR-IOV)之類的功能時它非常有用,因為 SR-IOV流量不通過 Hyper-V交換機。因此,它無法受到 Hyper-V交換機下的組的保護。通過此虛擬機組合選項,管理員可以設置兩個 Hyper-V交換機,每個交換機都連接到其自己的支持 SR-IOV的網(wǎng)絡適配器。此時:

每個虛擬機可以從一個或兩個 SR-IOV網(wǎng)絡適配器安裝虛擬功能。然后,當網(wǎng)絡適配器斷開連接時,虛擬機可以從主虛擬功能故障轉移到備份虛擬功能。

或者,虛擬機也可能擁有從一個網(wǎng)絡適配器和一個非虛擬功能網(wǎng)絡適配器到其他交換機的虛擬功能。如果與虛擬功能關聯(lián)的網(wǎng)絡適配器斷開連接,則流量可以故障轉移到其他交換機,而不會失去連接。

由于在虛擬機中網(wǎng)絡適配器之間的故障轉移可能會導致流量與其他網(wǎng)絡適配器的 MAC地址一起發(fā)送,因此與使用 NIC組合的虛擬機關聯(lián)的每個 Hyper-V交換機端口都必須設置為允許 MAC欺騙或必須使用Set-VmNetworkAdapter PowerShell cmdlet設置“AllowTeaming=On”參數(shù)。

不兼容性:NIC組合與 WindowsServer 2012中的所有網(wǎng)絡功能兼容,但有三個例外:SR-IOV、遠程直接內(nèi)存訪問 (RDMA) TCP煙囪。對于 SR-IOV和遠程直接內(nèi)存訪問 (RDMA),將數(shù)據(jù)直接發(fā)送給網(wǎng)絡適配器,而不經(jīng)過網(wǎng)絡堆棧。因此,網(wǎng)絡適配器組合無法查找數(shù)據(jù)或將數(shù)據(jù)重定向到組中的另一個路徑。Windows Server 2012 中的 NIC組合不支持 TCP煙囪。

雖然Windows Server? 2012提供并行的負載分配與故障轉移,但不確保 NIC組中 NIC之間的負載分配處于平衡狀態(tài)。在 Windows Server? 2012 R2中,動態(tài)負載平衡會持續(xù)自動地在 NIC組中的 NIC之間移動通信流,以盡可能均衡地分擔流量負載。

3、Hyper-V網(wǎng)絡虛擬化能夠與 Hyper-V虛擬交換機的第三方轉發(fā)擴展共存

現(xiàn)在,Hyper-V網(wǎng)絡虛擬化 (HNV)環(huán)境中的 Hyper-V虛擬交換機上安裝的轉發(fā) Hyper-V虛擬交換機擴展可以轉發(fā) VM客戶地址 (CA)空間或物理地址 (PA)空間的數(shù)據(jù)包,因為交換機擴展現(xiàn)在能夠與使用網(wǎng)絡虛擬化通用路由封裝 (NVGRE)的網(wǎng)絡虛擬化無縫共存。如果你安裝了第三方轉發(fā)擴展,Hyper-V虛擬交換機現(xiàn)在將執(zhí)行混合轉發(fā)。使用混合轉發(fā)時,已進行 NVGRE封裝的網(wǎng)絡流量將由交換機中的 HNV模塊轉發(fā),而所有非 NVGRE網(wǎng)絡流量將由你安裝的第三方轉發(fā)擴展轉發(fā)。除了轉發(fā)以外,第三方轉發(fā)擴展仍可向進行 NVGRE封裝的流量和未進行 NVGRE封裝的流量應用其他策略,例如 ACL QoS。安裝的轉發(fā)擴展必須能夠根據(jù)這兩種類型的網(wǎng)絡流量的預期目標來處理這些網(wǎng)絡流量。例如,對于執(zhí)行交換機組負載平衡的擴展而言,需要提供 PA地址可見性。Hyper-V虛擬交換機與第三方擴展的策略和功能不會彼此替代,它們是相輔相成的。

4、使用 vRSS 緩解 VM的流量瓶頸

Windows Server 2012中,支持通過 SR-IOV 進行接收方縮放 (RSS);而現(xiàn)在在 Windows Server 2012 R2 中,VM網(wǎng)絡路徑支持虛擬 RSS (vRSS),因此 VM可承受更大的網(wǎng)絡流量負載。以前,由于處理負載在單個 CPU核心上發(fā)生,因此 VM難以實現(xiàn)接近 10Gbps的網(wǎng)絡吞吐量。vRSS通過將處理分散到主機上的多個核心以及 VM上的多個核心來緩解這種問題。若要充分利用 vRSS,必須將 VM 配置為使用多個核心,并且 VM必須支持 RSS。 當 VM VM網(wǎng)絡路徑上使用 RSS時,將自動啟用 vRSS。

5、網(wǎng)絡跟蹤已簡化,可提供更多詳細信息

現(xiàn)在,網(wǎng)絡跟蹤包含交換機和端口配置信息,并且可以更方便地使用和讀取通過 Hyper-V虛擬交換機以及你安裝的任何轉發(fā)擴展的跟蹤數(shù)據(jù)包.統(tǒng)一跟蹤能使網(wǎng)絡管理員更有效地捕獲網(wǎng)絡流量,提高解決網(wǎng)絡問題過程的效率??梢允褂媒y(tǒng)一跟蹤捕獲發(fā)源于或終止于虛擬機的內(nèi)部虛擬機 (VM) 流量,以及捕獲發(fā)源于或終止于物理計算機的物理計算機流量。捕獲同一臺物理計算機上 VM之間的網(wǎng)絡流量:假定在單一物理計算機上具有多個虛擬網(wǎng)絡。統(tǒng)一跟蹤可以捕獲同一網(wǎng)絡的各 VM間的流量,也可以捕獲不同虛擬網(wǎng)絡的各 VM間的流量。

實驗一:NIC Team創(chuàng)建(注意主機安裝了Hyper-v之后不能創(chuàng)建NIC Team報錯)

1、準備一臺安裝了WindwosServer 2012操作系統(tǒng)的服務器。網(wǎng)卡兩塊或以上,名為host1

2、查看用于構建NIC Team可以使用的網(wǎng)卡

   Get-NetAdapter

3、創(chuàng)建名為Team1NIC Team。網(wǎng)卡使用NIC1,NIC2,由于不插在同一個交換機上所以模式為獨立,分流方式為Hyper-v端口

New-NetLbfoTeam -NameTeam1 -TeamNicName Team1

  -TeamMembers NIC1,NIC2 -TeamingMode SwitchIndependent

 -LoadBalancingAlgorithm HyperVPort

 Get-NetLbfoTeam | Format-Table-AutoSize

4、創(chuàng)建名為Team2NIC Team。網(wǎng)卡使用Slot 2,Slot 2 2,由于插在相同的交換機上所以模式為Staict.分流方式為源和目標TCP端口(TransportPorts

  New-NetLbfoTeam -Name Team2 -TeamNicName Team2 -TeamMembers 'slot2','slot 2 2' -TeamingMode Static -LoadBalancingAlgorithmTransportPorts

 Get-NetLbfoTeam | Format-Table-AutoSize

5、在Team1組合上移除網(wǎng)卡NIC2,添加網(wǎng)卡Slot 2 3作為備用網(wǎng)卡

Remove-NetLbfoTeamMember-Name NIC2 -Team Team1

Add-NetLbfoTeamMember -NameSlot 2 3 -Team Team2 -AdministrativeMode Standby //模式問題導致不能添加做備份

Get-NetLbfoTeam | Format-Table -AutoSize

6、如果要刪除所有NIC Teaming配置請執(zhí)行以下命令

  Remove-NetLbfoTeam -Name Team1,Team2 //我這邊斷網(wǎng)所以逐一移除

    Get-NetLbfoTeam | Format-Table-AutoSize

實驗二:Mutiple Virtual NICs

  1. 準備一臺物理服務器支持硬件虛擬化功能并啟用虛擬化支持,Host1物理服務器上安裝Hyper-v角色。

    Get-WindowsFeaturehyper-v

    Install-WindowsFeature -name hyper-v -IncludeAllSubFeature-IncludeManagementTools -Restart //如果沒有安裝執(zhí)行此命令

  2. 完成hyper-v角色安裝后,創(chuàng)建Multiple Virtual NICs,并分配指定VLAN,隔離流量。

    Get-VMNetworkAdapter * -ManagementOS 

    Add-VMNetworkAdapterManagementOSNameManagement

    Add-VMNetworkAdapterManagementOSNameStorage

    Add-VMNetworkAdapterManagementOSNameLive Migration

    Add-VMNetworkAdapterManagementOSNameVirtual Machine

    Set-VMNetworkAdapterVlan-VMNetworkAdapterName 'Management' -ManagementOS -Untagged

    Set-VMNetworkAdapterVlan-VMNetworkAdapterName 'Storage' -ManagementOS -Access -VlanId 1000

    Set-VMNetworkAdapterVlan-VMNetworkAdapterName 'Live Migration' -ManagementOS -Access -VlanId 2000

  3. 移除所有Virtual NICs,還原環(huán)境

    Remove-VMNetworkAdapter -name 'Management' -ManagementOS

    Remove-VMNetworkAdapter -name'Storage' -ManagementOS

    Remove-VMNetworkAdapter -name 'Live Migration' -ManagementOS

    Remove-VMNetworkAdapter -Name 'VirtualMachine' -ManagementOS

    Get-VMNetworkAdapter * -ManagementOS 

實驗三:在虛擬化環(huán)境中應用ACL

  1. 根據(jù)實驗二環(huán)境,創(chuàng)建一個橋接到物理網(wǎng)絡的虛擬交換機vswitch。提供給虛擬機訪問外網(wǎng)

  2. Host1上分別安裝兩臺windows server 2012 R2的虛擬機名為WebserverDatabase.并連接到vswitch虛擬交換機。Webserver上搭建一個簡單的IIS網(wǎng)站端口用80Red1上搭建一個簡單的IIS網(wǎng)站端口用1433

  3. 在兩臺虛擬機的系統(tǒng)防火墻開啟各自的服務端口,此時兩臺虛擬機可以訪問彼此的服務和Internet

  4. 設置Database虛擬機只接受Webserver虛擬機的1433訪問,其他所有出站和入站的流量全部拒絕。

#首先獲得兩臺虛擬機的網(wǎng)絡配置

Get-VMNetworkAdapter *

#創(chuàng)建擴展型的ACL阻止Database服務器所有的出站和進站流量,只允許服務器214.214.51.80webserver)訪問1433的服務。注意weight值越大,最先處理此規(guī)則

Add-VMNetworkAdapterExtendedAcl –VMNameDatabase -LocalIPAddress'214.214.51.81' -Action deny-Direction Inbound -Weight 1 //封殺進站流量

Add-VMNetworkAdapterExtendedAcl –VMNameDatabase -LocalIPAddress'214.214.51.81' -Action deny -Direction outbound -Weight 1 //封殺出戰(zhàn)流量

Add-VMNetworkAdapterExtendedAcl -VMName Database -LocalIPAddress '214.214.51.81' -Protocol TCP -LocalPort 1433 -RemoteIPAddress'214.214.51.80'  -DirectionInbound -Action Allow -Weight 10  -Stateful $true //僅允許webserver訪問database1433

Get-VMNetworkAdapterExtendedAcl|Format-Table -AutoSize

  1. 設置Webserver服務器能夠訪問Database1433服務端口,能夠讓用戶訪問自己的80服務端口,其他出站和進站流量全部拒絕

#獲得兩臺虛擬機的網(wǎng)絡配置

Get-VMNetworkAdapter *

#創(chuàng)建擴展型的ACL阻止Webserver服務器所有的出站和進站流量,只允許遠端電腦訪問80的服務,并且Webserver服務器可以訪問Database服務器的1433服務。注意weight值越大,最先處理此規(guī)則

Add-VMNetworkAdapterExtendedAcl –VMNameWebserver -LocalIPAddress'214.214.51.80' -Action deny-Direction Inbound -Weight 1 //封殺進站流量

Add-VMNetworkAdapterExtendedAcl –VMNameWebserver -LocalIPAddress'214.214.51.80' -Action deny -Direction outbound -Weight 1 //封殺出站流量

Add-VMNetworkAdapterExtendedAcl -VMName Webserver -LocalIPAddress '214.214.51.80' -RemoteIPAddress'214.214.51.81' -RemotePort 1433 -Protocol TCP -Direction outbound -Action Allow -Stateful$true -Weight 10 //只允許出站訪問Database1433

Add-VMNetworkAdapterExtendedAcl -VMName Webserver -LocalIPAddress '214.214.51.80' -Protocol TCP -LocalPort 80 -Direction Inbound -Action Allow -Stateful $true -IdleSessionTimeout 3600 -Weight 20 //只允許入站訪問自己的80

查詢當前的擴展型ACL配置

Get-VMNetworkAdapterExtendedAcl* | Format-table -AutoSize

  1. 清除所有ACL配置:還原環(huán)境

Remove-VMNetworkAdapterExtendedAcl-VMName database -Direction outbound -Weight 1

Remove-VMNetworkAdapterExtendedAcl-VMName database -Direction inbound -Weight 1

Remove-VMNetworkAdapterExtendedAcl-VMName database -Direction inbound -Weight 10

Remove-VMNetworkAdapterExtendedAcl -VMName Webserver -Direction outbound -Weight 1

Remove-VMNetworkAdapterExtendedAcl -VMName Webserver -Direction inbound -Weight 1

Remove-VMNetworkAdapterExtendedAcl -VMName Webserver-Direction outbound -Weight 10

Remove-VMNetworkAdapterExtendedAcl -VMName Webserver-Direction inbound -Weight 20

Get-VMNetworkAdapterExtendedAcl* | Format-table -AutoSize

實驗四:虛擬化環(huán)境中應用VLANPVLAN

  1. 在實驗三環(huán)境基礎上,在Host1主機上添加兩臺虛擬機分別名為AppserverPC,兩臺虛擬機的網(wǎng)絡都橋接到vswitch

  2. 四臺虛擬機的防火墻都停掉,用于測試網(wǎng)絡的聯(lián)通性。

  3. 對四臺虛擬機設置不同VLAN,只允許WebserverDatabase互通,AppserverPC互通。

    Get-VMNetworkAdapter * | format-table -autosize

    Set-VMNetworkAdapterVlan -VMName Webserver-Access -VlanId 10

    Set-VMNetworkAdapterVlan -VMName Database-Access -VlanId 10

    Set-VMNetworkAdapterVlan -VMName Appserver-Access -VlanId 20

    Set-VMNetworkAdapterVlan -VMName PCaccessVlanId 20 

    Get-VMNetworkAdapterVlan * | format-table-autosize

  4. 修改VLAN設置,讓虛擬機PC可以訪問WebserverDatabase服務器。

Set-VMNetworkAdapterVlan -VMName PC -Trunk-NativeVlanId 10 -AllowedVlanIdList10-20

但是無法訪問Appserver。那么有沒有辦法可以PC訪問所有服務器呢?但又能隔離服務器呢?這時PVLAN就誕生了

  1. 移除所有vlan配置,還原環(huán)境

    Set-VMNetworkAdapterVlan -VMNamewebserver,database,appserver,pc -Untagged 

    Get-VMNetworkAdapterVlan * | format-table-autosize

  2. 將虛擬機WebserverDatabase設置為PVLAN的團體模式,主VLAN100,輔助VLAN110將虛擬機Appserver設置為PVLAN隔離模式,主VLAN100,輔助VLAN120.將虛擬機PC設置為PVLAN混雜模式,主VLAN100,輔助是VLAN110120

    Set-VMNetworkAdapterVlan -VMNamewebserver,database -Community -PrimaryVlanId 100 -SecondaryVlanId 110

    Set-VMNetworkAdapterVlan -VMName appserver-Isolated -PrimaryVlanId 100-SecondaryVlanId 120

    Set-VMNetworkAdapterVlan -VMName pc-Promiscuous -PrimaryVlanId 100-SecondaryVlanIdList 110-120

    Get-VMNetworkAdapterVlan * | format-tableautosize

  3. 測試PVLAN的效果

    PC可以Ping通所有服務器

    WebserverDatabase可以互訪,兩者都可以訪問PC,但是不能訪問Appserver

    Appserver只能訪問PC

  4. 移除PVLAN的所有配置

    Set-VMNetworkAdapterVlan -VMNamewebserver,database,appserver,pc -Untagged 

    Get- VMNetworkAdapterVlan *

幾個實驗都是Powershell的展示,用powershell完成所有設定。要重視Powershell的編程能力了。Powershell使Windows server 2012更靈活。管理員懂的

視頻分享:http://pan.baidu.com/s/1dDzNA17

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多