How To Configure Hyper-V Virtual Switch That Supports NAT ...
文章推薦指數: 80 %
In Windows Server 2016 Technical Preview 4 and Windows 10 build #1058, Microsoft included a new Virtual Switch Type called Network Address ...
Skiptocontent
CHARBELNEMNOMSharethispost:ShareonTwitter
ShareonFacebook
ShareonLinkedIn
ShareonEmail[Updated03/05/2016:New-ContainerNetworkattheendofthispost]InThisArticleIntroductionNetworkAddressTranslationOverviewStep1–CreateinternalvirtualswitchStep2–ConfigureNATgatewayStep3–ConfigureNATNetworkStep 4–Connectyourvirtualmachinetotheinternal“NAT”networkswitchContainersNetworkIntroductionInWindowsServer2016TechnicalPreview4andWindows10build#1058,MicrosoftincludedanewVirtualSwitchTypecalledNetworkAddressTranslation(NAT),whichallowsVirtualMachinestohaveanInternalNetworkandconnecttothephysicalworldandhaveInternetaccess.TheNATmodewasbasicallybuiltforWindowsServerContainersandHyper-VContainers,becauseWindowscontainersfunctionsimilarlytovirtualmachinesinregardstonetworking.Eachcontainerhasavirtualnetworkadapterwhichisconnectedtoavirtualswitch,overwhichinboundandoutboundtrafficisforwarded.ThisfeatureissoconvenienttogiveInternetaccesstovirtualmachineswithoutbridgingtheWi-FiadaptersorusingRRAS/Linuxserver.ThisfeaturewasnotexposedintheUI,youneedtousePowerShelltocreatethe“NAT”VirtualSwitchtype.InWindowsServer2016TechnicalPreview5andthelatestWindows10build#14295,Microsoftremoved“NAT”VMSwitchType…It’sgone!However,thegoodnewsis,theNATnetworkscanstillbecreatedandcustomizedusingPowerShellcmdletsbutindifferentway.NetworkAddressTranslationOverviewEachvirtualmachineisconnectedtoaninternalvirtualswitchandwilluseWinNATtoconnecttoaprivateIPsubnet.WinNATgivesavirtualmachineaccesstonetworkresourcesusingthehostcomputer’sIPaddressandaport.WinNATwillperformbothnetworkaddresstranslation(NAT)andportaddresstranslation(PAT)betweenthecontainer/Hyper-Vhostandthecontainers/virtualmachinesthemselves.ThisfeatureisnotincludedintheUIofcourse,butyoucanusePowerShelltocreatethe“NAT”internalVirtualSwitch.Step1–CreateinternalvirtualswitchNew-VMSwitch–SwitchName“NAT_vSwitch”–SwitchTypeInternal–VerboseStep2–ConfigureNATgatewayInordertoconfigureaNATgatewayusingNew-NetIPAddress,you’llneedabitofinformationaboutyournetwork,youwouldusethefollowingsyntax.NoticethatadditionalparametersincludingIPAddress,PrefixLengthandInterfaceIndexcanbespecifiedbyusingPowerShell.New-NetIPAddress–IPAddress172.31.1.1-PrefixLength24-InterfaceIndex16–VerboseIPAddress:IPv4orIPv6addresstouseastheNATgatewayIPwhichwillbeassignedtothe(vEthernet)internalswitch.PrefixLength:Isasubnetmask,therangewillbeavaluefrom0upto32.YouwanttodefineaSubnetMasktobeusedbytheNATinternalswitch.InterfaceIndex:IstheinterfaceindexoftheinternalswitchthatwecreatedinStep1.YoucanuseGet-NetAdaptertodeterminetheifIndexnumber.Inmycasehere,theInterfaceIndexis16.Step3–ConfigureNATNetworkInordertoconfigureaNATnetworkusingNew-NetNat,you’llneedalsoabitofinformationaboutyournetworkandtheNATgatewayweconfiguredinStep2.youwouldusethefollowingsyntax.NoticethatadditionalparametersincludingNameandInternalIPInterfaceAddressPrefix.New-NetNat–NameNATNetwork–InternalIPInterfaceAddressPrefix172.31.1.0/24–VerboseName:ThisisthenameoftheNATnetwork.IfyouwanttoremovetheNATnetworkinthefuture,you needto useRemove-NetNAT–Name
延伸文章資訊
- 1win10使用Hyper-V建立NAT - IT閱讀
win10使用Hyper-V建立NAT ... 設定你要用NAT的虛擬機器使用剛才的那塊新建網絡卡 ... MCSA / Windows Server 2016 使用Hyper-V組件搭建實驗環...
- 2Windows 10 pro as a NAT between two interfaces (to route VM ...
Is there a way to achieve this in win10 pro, or do I need windows server? This is annoying also b...
- 3設定NAT 網路
Windows 10 Hyper-V 可促成虛擬網路的原生網路位址轉譯(NAT)。 ... 這是近期組建的Bug 所造成(包括Windows Server 2016 Technical Prev...
- 4NAT server configuration in Windows 10 Pro environment?
NAT server configuration in Windows 10 Pro environment? I want to implement the router function t...
- 5Windows 上的NAT 類型顯示「Teredo 無法取得資格」 - Xbox ...
Teredo 是一種網路通訊協定,用以在用戶端與伺服器間建立通訊,以及針對在使用網路位址轉譯(NAT) 之路由器後方的裝置,加速彼此間的連線能力。 在Teredo 介面卡出現問題、 ...