Skip to content

Instantly share code, notes, and snippets.

@msjyoo
Last active April 6, 2021 08:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save msjyoo/78b741fb48a9f0936e20 to your computer and use it in GitHub Desktop.
Save msjyoo/78b741fb48a9f0936e20 to your computer and use it in GitHub Desktop.
How to set up NAT for Internet access with Hyper-V
In the Virtual SAN Editor:
Select Internal mode.
Then, open cmd, type in `ipconfig`.
You should see something like this:
```
Ethernet adapter vEthernet (Internal Virtual Switch 1):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : xxmacaddressxx:1:2:3:randomidentifier
Autoconfiguration IPv4 Address. . : 169.254.101.196
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
```
Now, in your guest operating system, the network settings should be:
```
IP: 169.254.101.197 (Or any other in the /16)
Subnet Mask: 255.255.0.0
Gateway: 169.254.101.196 (This IP is your computer. So instead of traffic going VM -> Router -> Internet, this way the traffic goes VM -> Host OS -> Router -> Internet. This is called NAT)
DNS Servers: Any you like (Use 8.8.8.8 8.8.4.4 for Google's Public DNS)
```
Enjoy!
Edit: Make sure you also enable ICS (Internet Connection Sharing or IP Forwarding in Linux?) as per this answer: http://superuser.com/questions/531590/windows-8-hyper-v-network-not-working-on-host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment