Jump to content

Recommended Posts

Posted

Hi all,

 

Within Hyper-V I can assign a NIC and configure it as a Virtual Switch. How (if it's possible), can I have two independent Virtual Switches/NICs in a single Hyper-V'ed instance?

 

This is of course possible on the Hyper-V host, and a physical computer with dual NICs, but what about Hyper-V'ed guests?

Posted
What's the end goal? What are you trying to achieve or why are you doing it this way. Vswitches are on the host - are you trying to create another abstracted layer of vswitches running on a virtual instances of hyper v? :confused:
Posted

Think of it like this -

 

NIC1 configured as 192.168.1.1, 255.255.255.0, (No Gateway)

NIC2 configured as 192.168.0.2, 255.255.255.0, 192.168.0.25 (Gateway)

 

You can do this on physical and Hyper-V hosts, but doesn't appear possible on Hyper-V guests.

Posted (edited)

You should be able to do this on guests, just add the vnics and then apply the IP settings, are the subnets on different vlans? If so the vnics have a setting to tag the traffic with the correct vlan ID and go from there. This is a guest VM on a Hyper-V host and it has more vnics than shown here with different IPs on different vlans etc.:

virt-smoothwall.png

~~~EDIT~~~

Default behaviour will be for the vnic to be untagged so when it hits your vswitch so the traffic will continue on its untagged path, if you start tagging traffic at the vnics and have the uplinks to the vswitch setup to expect tagged traffic at hardware switch level the vswitch should flow the traffic as expected to the correct vlans.

 

Does what I said make sense? Does it help at all?

Edited by ThomL
Posted
Think of it like this -

 

NIC1 configured as 192.168.1.1, 255.255.255.0, (No Gateway)

NIC2 configured as 192.168.0.2, 255.255.255.0, 192.168.0.25 (Gateway)

 

You can do this on physical and Hyper-V hosts, but doesn't appear possible on Hyper-V guests.

Adding additional NICs to a guest VM is as easy as going into the settings for the VM and adding another Network Adapter. :confused:

 

1wAXkCY.png

Posted
You should be able to do this on guests, just add the vnics and then apply the IP settings, are the subnets on different vlans? If so the vnics have a setting to tag the traffic with the correct vlan ID and go from there. This is a guest VM on a Hyper-V host and it has more vnics than shown here with different IPs on different vlans etc.:

[ATTACH=CONFIG]52582[/ATTACH]

~~~EDIT~~~

Default behaviour will be for the vnic to be untagged so when it hits your vswitch so the traffic will continue on its untagged path, if you start tagging traffic at the vnics and have the uplinks to the vswitch setup to expect tagged traffic at hardware switch level the vswitch should flow the traffic as expected to the correct vlans.

 

Does what I said make sense? Does it help at all?

 

Sort of, but your screenshot is from Smoothwall, rather than Hyper-V. I'm still unclear how it's possible.

Posted
Adding additional NICs to a guest VM is as easy as going into the settings for the VM and adding another Network Adapter. :confused:

 

1wAXkCY.png

 

I'm using a 2016 Hyper-V host and the guest is also 2016.

 

Highlighting the VM, selecting Settings, then Network Adapter, I can only select one of the virtual adapters at a time, (from the drop down) when I require both.

Posted
Highlighting the VM, selecting Settings, then Network Adapter, I can only select one of the virtual adapters at a time, (from the drop down) when I require both.

Does the following work for you?

 

Highlight VM > select Settings > Add Hardware > select Network Adapter > click Add > select the Virtual Switch from the dropdown box > click Apply.

 

If your VM already has a NIC, you should end up with two NICs now.

  • Thanks 1
Posted
Sort of, but your screenshot is from Smoothwall, rather than Hyper-V. I'm still unclear how it's possible.

 

My screenshot is of a smoothwall virtual machine located on a hyper v host, here are the settings for the vm:

virt-smoothwall-VM-Settigns.png

 

All the vnics are connected to the same vswitch 'LAN' but each vnic has a setting to tag the traffic coming out of the vnic (as see in screenshot). traffic then hits the vswitch with a vlan ID attached, the vswitch on the hyper v host has physical connections to a physical switch - on the physical switch the port/s that connect to the vswitch's (via Physical Nics on the host) are configured to expect traffic tagged with vlan id and uses vlans to get the traffic to the correct destination.

 

you said you have:

NIC1 configured as 192.168.1.1, 255.255.255.0, (No Gateway)

NIC2 configured as 192.168.0.2, 255.255.255.0, 192.168.0.25 (Gateway)

 

Are those 2 networks physically separated, or using vlans or do they both sit in the same lan without any separation?

  • Thanks 1
Posted
Does the following work for you?

 

Highlight VM > select Settings > Add Hardware > select Network Adapter > click Add > select the Virtual Switch from the dropdown box > click Apply.

 

If your VM already has a NIC, you should end up with two NICs now.

 

That's solved it, thank you. I think I was having a moment!!

 

- - - Updated - - -

 

My screenshot is of a smoothwall virtual machine located on a hyper v host, here are the settings for the vm:

[ATTACH=CONFIG]52583[/ATTACH]

 

All the vnics are connected to the same vswitch 'LAN' but each vnic has a setting to tag the traffic coming out of the vnic (as see in screenshot). traffic then hits the vswitch with a vlan ID attached, the vswitch on the hyper v host has physical connections to a physical switch - on the physical switch the port/s that connect to the vswitch's (via Physical Nics on the host) are configured to expect traffic tagged with vlan id and uses vlans to get the traffic to the correct destination.

 

you said you have:

NIC1 configured as 192.168.1.1, 255.255.255.0, (No Gateway)

NIC2 configured as 192.168.0.2, 255.255.255.0, 192.168.0.25 (Gateway)

 

Are those 2 networks physically separated, or using vlans or do they both sit in the same lan without any separation?

 

Makes complete sense now, just completely overlooked the Add Hardware function. You live and learn!

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...