Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create NAT
Windows 2012 R2のHyper-V用NAT
New-VMSwitch -SwitchName "Hyper-V-Switch" - SwitchType Internal
Get-NetIPAddress -InterfaceAlias "vEthernet (Hyper-V-Switch)"
IPAddress : 169.254.141.105 ……… 適当なものが振られる
InterfaceIndex : n ………………… 後で使う
InterfaceAlias : vEthernet (Hyper-V-Switch)
AddressFamily : IPv4
Type : Unicast
PrefixLength : 16
……
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex n
IPAddress : 192.168.0.1
InterfaceIndex : n
InterfaceAlias : vEthernet (Hyper-V-Switch)
AddressFamily : IPv4
Type : Unicast
……
New-NeNnat -Name Hyper-V-NAT -ExternalIPInterfaceAddressPrefix 外部IPアドレス/32
... InternalIPInterfaceAddressPrefixではない
Add-NetNatExternalAddress -Natname Hyper-V-NAT -IPAddress 外部IPアドレス
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.