Hyper-Vのインストール
1 |
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart |
NATの仮想スイッチを作成する
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
PS C:\Users\yuta> New-VMSwitch -Name "InternalNAT" -SwitchType Internal Name SwitchType NetAdapterInterfaceDescription ---- ---------- ------------------------------ InternalNAT Internal PS C:\Users\yuta> Get-NetAdapter Name InterfaceDescription ifIndex Status MacAddress LinkSpeed ---- -------------------- ------- ------ ---------- --------- vEthernet (InternalNAT) Hyper-V Virtual Ethernet Adapter 12 Up 00-15-5D-02-05-00 10 Gbps Ethernet Microsoft Hyper-V Network Adapter 3 Up 00-22-48-66-BD-A9 50 Gbps PS C:\Users\yuta> New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex 12 IPAddress : 192.168.0.1 InterfaceIndex : 12 InterfaceAlias : vEthernet (InternalNAT) AddressFamily : IPv4 Type : Unicast PrefixLength : 24 PrefixOrigin : Manual SuffixOrigin : Manual AddressState : Tentative ValidLifetime : Infinite ([TimeSpan]::MaxValue) PreferredLifetime : Infinite ([TimeSpan]::MaxValue) SkipAsSource : False PolicyStore : ActiveStore IPAddress : 192.168.0.1 InterfaceIndex : 12 InterfaceAlias : vEthernet (InternalNAT) AddressFamily : IPv4 Type : Unicast PrefixLength : 24 PrefixOrigin : Manual SuffixOrigin : Manual AddressState : Invalid ValidLifetime : Infinite ([TimeSpan]::MaxValue) PreferredLifetime : Infinite ([TimeSpan]::MaxValue) SkipAsSource : False PolicyStore : PersistentStore PS C:\Users\yuta> New-NetNat -Name "InternalNat" -InternalIPInterfaceAddressPrefix 192.168.0.0/24 Name : InternalNat ExternalIPInterfaceAddressPrefix : InternalIPInterfaceAddressPrefix : 192.168.0.0/24 IcmpQueryTimeout : 30 TcpEstablishedConnectionTimeout : 1800 TcpTransientConnectionTimeout : 120 TcpFilteringBehavior : AddressDependentFiltering UdpFilteringBehavior : AddressDependentFiltering UdpIdleSessionTimeout : 120 UdpInboundRefresh : False Store : Local Active : True |