开心六月综合激情婷婷|欧美精品成人动漫二区|国产中文字幕综合色|亚洲人在线成视频

    1. 
      
        <b id="zqfy3"><legend id="zqfy3"><fieldset id="zqfy3"></fieldset></legend></b>
          <ul id="zqfy3"></ul>
          <blockquote id="zqfy3"><strong id="zqfy3"><dfn id="zqfy3"></dfn></strong></blockquote>
          <blockquote id="zqfy3"><legend id="zqfy3"></legend></blockquote>
          打開APP
          userphoto
          未登錄

          開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

          開通VIP
          Windows Server 2012&R2超級(jí)虛擬化之十 軟件定義網(wǎng)絡(luò)之虛擬交換機(jī)

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

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

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

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

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

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

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

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

          1Windows 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

          3、Port 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

          4MacAddressSpoofing

          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

          6DHCPGuard

          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

          9Port 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

          10IPsec 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.

          11Receive 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

          12Hyper-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.

          13Hyper-v SR-IOV

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

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

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

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

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

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

          一個(gè)PCIExpress網(wǎng)絡(luò)設(shè)備,其中有SR-IOV的能力驅(qū)動(dòng)程序模型,同時(shí)支持PFVFS。

          Windows Server 2012 R2Hyper-V可擴(kuò)展的虛擬交換機(jī)的又有了更強(qiáng)的功能:

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

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

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

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

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

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

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

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

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

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

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

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

          1. 帶寬聚合

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

          下面是基本的用于 NIC組合的算法,這兩種模式都會(huì)導(dǎo)致入站和出站流量接近聚合帶寬的實(shí)際限制,原因是組中的鏈路池相當(dāng)于一個(gè)管道:

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

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

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

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

          Hyper-V交換機(jī)端口。當(dāng)虛擬機(jī)具有獨(dú)立的媒體訪問控制 (MAC)地址時(shí),虛擬機(jī)的 MAC地址可以為劃分流量提供基礎(chǔ)。在虛擬化中使用這種方案具有優(yōu)勢(shì)。因?yàn)橄噜彽慕粨Q機(jī)可以確定特定源 MAC地址位于唯一一個(gè)連接的網(wǎng)絡(luò)適配器上,交換機(jī)將根據(jù)虛擬機(jī)的目標(biāo) MAC地址在多個(gè)鏈路上平衡外出負(fù)載(從交換機(jī)到計(jì)算機(jī)的流量)。當(dāng)與虛擬機(jī)隊(duì)列一起使用時(shí)該方案非常有用。但是,這種模式可能不夠具體,因而無法獲得較為平衡的分發(fā),并且它將單個(gè)虛擬機(jī)限制為單個(gè)網(wǎng)絡(luò)適配器上可用的帶寬。Windows Server 2012 使用 Hyper-V交換機(jī)端口作為標(biāo)識(shí)符,而不是源 MAC地址,因?yàn)樵谀承┣闆r下,一個(gè)虛擬機(jī)可能使用交換機(jī)端口上的多個(gè) MAC地址

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

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

          源和目標(biāo) MAC地址

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

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

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

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

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

          每個(gè)虛擬機(jī)可以從一個(gè)或兩個(gè) SR-IOV網(wǎng)絡(luò)適配器安裝虛擬功能。然后,當(dāng)網(wǎng)絡(luò)適配器斷開連接時(shí),虛擬機(jī)可以從主虛擬功能故障轉(zhuǎn)移到備份虛擬功能。

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

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

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

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

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

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

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

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

          5網(wǎng)絡(luò)跟蹤已簡(jiǎn)化,可提供更多詳細(xì)信息

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

          實(shí)驗(yàn)一:NIC Team創(chuàng)建(注意主機(jī)安裝了Hyper-v之后不能創(chuàng)建NIC Team會(huì)報(bào)錯(cuò))

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

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

             Get-NetAdapter

          3、創(chuàng)建名為Team1NIC Team。網(wǎng)卡使用NIC1,NIC2,由于不插在同一個(gè)交換機(jī)上所以模式為獨(dú)立,分流方式為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,由于插在相同的交換機(jī)上所以模式為Staict.分流方式為源和目標(biāo)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 //模式問題導(dǎo)致不能添加做備份

          Get-NetLbfoTeam | Format-Table -AutoSize

          6、如果要?jiǎng)h除所有NIC Teaming配置請(qǐng)執(zhí)行以下命令

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

              Get-NetLbfoTeam | Format-Table-AutoSize

          實(shí)驗(yàn)二:Mutiple Virtual NICs

          1. 準(zhǔn)備一臺(tái)物理服務(wù)器支持硬件虛擬化功能并啟用虛擬化支持,Host1物理服務(wù)器上安裝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 

          實(shí)驗(yàn)三:在虛擬化環(huán)境中應(yīng)用ACL

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

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

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

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

          #首先獲得兩臺(tái)虛擬機(jī)的網(wǎng)絡(luò)配置

          Get-VMNetworkAdapter *

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

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

          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. 設(shè)置Webserver服務(wù)器能夠訪問Database1433服務(wù)端口,能夠讓用戶訪問自己的80服務(wù)端口,其他出站和進(jìn)站流量全部拒絕

          #獲得兩臺(tái)虛擬機(jī)的網(wǎng)絡(luò)配置

          Get-VMNetworkAdapter *

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

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

          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

          查詢當(dāng)前的擴(kuò)展型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

          實(shí)驗(yàn)四:虛擬化環(huán)境中應(yīng)用VLANPVLAN

          1. 在實(shí)驗(yàn)三環(huán)境基礎(chǔ)上,在Host1主機(jī)上添加兩臺(tái)虛擬機(jī)分別名為AppserverPC,兩臺(tái)虛擬機(jī)的網(wǎng)絡(luò)都橋接到vswitch

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

          3. 對(duì)四臺(tái)虛擬機(jī)設(shè)置不同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設(shè)置,讓虛擬機(jī)PC可以訪問WebserverDatabase服務(wù)器。

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

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

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

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

            Get-VMNetworkAdapterVlan * | format-table-autosize

          2. 將虛擬機(jī)WebserverDatabase設(shè)置為PVLAN的團(tuán)體模式,主VLAN100,輔助VLAN110。將虛擬機(jī)Appserver設(shè)置為PVLAN隔離模式,主VLAN100,輔助VLAN120.將虛擬機(jī)PC設(shè)置為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. 測(cè)試PVLAN的效果

            PC可以Ping通所有服務(wù)器

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

            Appserver只能訪問PC

          4. 移除PVLAN的所有配置

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

            Get- VMNetworkAdapterVlan *

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

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

          本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
          打開APP,閱讀全文并永久保存 查看更多類似文章
          猜你喜歡
          類似文章
          Hyper-V配置虛擬網(wǎng)絡(luò)
          檢查和驗(yàn)證虛擬網(wǎng)絡(luò)設(shè)置
          詳細(xì)講解Hyper
          Win10中被忽略的Hyper-V創(chuàng)建虛擬機(jī)系統(tǒng)超詳細(xì)步驟
          Hyper-V 網(wǎng)絡(luò)配置學(xué)習(xí)
          如何使用Hyper-v虛擬機(jī)?
          更多類似文章 >>
          生活服務(wù)
          分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
          綁定賬號(hào)成功
          后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
          如果VIP功能使用有故障,
          可點(diǎn)擊這里聯(lián)系客服!

          聯(lián)系客服