17.03.2013

Hyper-V: Howto configure NAT for virtual machines

In my last posting i explained how to configure a vEthernet adapter to get connectivity to the internet. But there was one "problem": You had to provide one seperate IP for each virtual host, you want to connect to the internet.
But there is a solution (NAT) for this problem and it is easy to configure this with Hyper-V on Windows:
[If you have not configured the "brigde"-solution i explained the last posting, then skip step 1 and start with step number 2]
  1. Unbridge your VSwitchExternal from Wifi
    (select both adapter in network adapters and do a right click an use "remove bridge")
  2. Create a new internal virtual switch via Hyper-V's virtual switch manager (look here, how to do this) and name it VSwitchNAT
  3. Edit properties of your Wifi adapter
    (right click and then properties)
  4. Open the tab "Sharing" and enable both Checkboxes.
    Choose "VSwitchNAT" for Home networking connection
And after that your virtual machines are using a private subnet which will be NATted by your laptop. This private subnet can be configured via VSwitchNAT:
  • Edit properties of VSwitchNAT vEthernet adpater
  • Edit properties of ipv4 and here you can edit the subnet

Keine Kommentare:

Kommentar veröffentlichen