Share via


Setting up "host-only adapter" equivalent

Question

Saturday, February 1, 2020 11:36 AM

Quick background to help explain the situation, I'm a cybersecurity student and i'm used to using virtualbox to learn the ins and outs of pen testing, we using kali and vulnerable OSs like Metasploitable to simulate attacks, this is what I'm trying to set up on hyper-v.

when you're using VMware or Virtual Box you have the option to setup a host-only adapter https://imgur.com/a/TVeZbd3 (screenshot host-adapter in VB), this allows VMs to communicate with each other and access the internet while being isolated from your host computer, this is obviously something you want to do when dealing with vulnerable OS's, u dont what them to create an opening to your host computer or internal network while while simulating pen testing.

I've tired for hours to set and "host-only" equivalent on hyper-v to avail... Any ideas? is this even possible to achieve with hyper-v?  

Kind Regards, and thank you in advance for your time.

All replies (3)

Saturday, February 1, 2020 2:48 PM âś…Answered | 1 vote

You can easily do by creating an external vSwitch of an unused physical adapter (uncheck box for allow management network to share this adapter) plugged into the isolated physical switch that provides a route to internet, then connect VMs to new vSwitch

Also since asking a question please change thread type from General Discussion to Question.

 

 

 

Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management

Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


Saturday, February 1, 2020 8:34 PM

In addition to Dave's suggestion, you can create an internal Hyper-V virtual switch and attach the hosts and guests to that.

If you don't want a second virtual switch, you can assign virtual adapters for the hosts and guests into a VLAN. Their Ethernet frames will appear on the physical adapters (you can see them in Wireshark) but unless your switch is capable of 802.1q tagging, has the physical port in a trunk mode, and allows that VLAN, then it will discard those frames without allowing them onto the fabric.

Eric Siron
Altaro Hyper-V Blog
I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.


Monday, February 3, 2020 9:00 AM

Hi TaylorSwifty,

Thanks for your post!

Simplily explaniation for Hyper V virtual switch:

1. External virtual switch

VM connect to external virutal switch can commincation in below:

a. VM to VM with same virtual switch.

b. VM to host. 

c. VM to outside network via host physical NIC.

2. Internal virtual switch

VM connect to internal virutal switch can commincation in below:

a. VM to VM with same virtual switch.

b. VM to host. 

3. Private virtual switch

VM connect to internal virutal switch can commincation in below:

a. VM to VM with same virtual switch.

Best Regards,

Anne

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].