Michael Posted March 12, 2019 Posted March 12, 2019 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?
Jaan Posted March 12, 2019 Posted March 12, 2019 Hyper-v role installed on guest OS with multiple virtual nics?
Michael Posted March 12, 2019 Author Posted March 12, 2019 You can Team, but that's not what I'm after. Plus in settings you can only specify one virtual switch per Hyper-V instance.
ThomL Posted March 12, 2019 Posted March 12, 2019 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?
Jaan Posted March 12, 2019 Posted March 12, 2019 Yeah i'm a little confused, isn't this nested virtualisation?
Michael Posted March 12, 2019 Author Posted March 12, 2019 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.
ThomL Posted March 12, 2019 Posted March 12, 2019 (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.: ~~~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 March 12, 2019 by ThomL
Arthur Posted March 12, 2019 Posted March 12, 2019 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.
Michael Posted March 12, 2019 Author Posted March 12, 2019 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.
Michael Posted March 12, 2019 Author Posted March 12, 2019 Adding additional NICs to a guest VM is as easy as going into the settings for the VM and adding another Network Adapter. 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.
Arthur Posted March 12, 2019 Posted March 12, 2019 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. 1
ThomL Posted March 12, 2019 Posted March 12, 2019 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: 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? 1
Michael Posted March 12, 2019 Author Posted March 12, 2019 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! 1
ThomL Posted March 12, 2019 Posted March 12, 2019 I can see how not noticing the Add Hardware area would cause this confusion - sorted!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now