Skip to main content

Add IP on vSwitch

So you installed hyper-v and you need to configure your NIC with your public IP and your secondary IP's, let me show you how.

(Would recommend having physical access / KVM IP if anything fails)

First create a v-Switch in the hyper-v settings.

Capture.PNG

Then, go to the IPv4 settings of your new hyper-v vswitch and add your primary IP.

Capture2.PNG

To add your secondary IP's, you will need to go the the advanced options and put in the first usable address of your secondary subnet, not the broadcast address but the first usable address and the subset below.

You will then use that address as the gateway for your VM's.

Capture3.PNG

Last step will be to enable ip forwarding, open power-shell as admin and type the following commands :

netsh
netsh> interface ipv4

Then the following command to view the list of available interfaces

netsh interface ipv4> show int

To view the interface settings, replace "15" by the proper ID :

netsh interface ipv4> show int 15

And finally, the following command to enable IP forwarding :    

netsh interface ipv4> set int 15 forwarding=enabled    

Capture4.PNG