Creating external and internal virtual switches in Hyper-V allows you to manage network connectivity for virtual machines. Here's how to create both types of switches:
1. Open Hyper-V Manager:
Press Win + X and select "Hyper-V Manager" from the menu, or search for it in the Start menu.
2. Create an External Virtual Switch:
In Hyper-V Manager, right-click on your Hyper-V host (usually listed under "Hyper-V Manager" in the left pane).
Choose "Virtual Switch Manager."
In the Virtual Switch Manager window, select "External" from the left-hand side.
Click the "Create Virtual Switch" button.
Give your new virtual switch a name, like "External Switch."
Under "External network," select the physical network adapter you want to bind the external switch to. This adapter should be connected to the external network/internet.
You can check the box that says "Allow management operating system to share this network adapter" if you want the host machine to have network connectivity through this virtual switch.
Click OK to create the external virtual switch.
3. Create an Internal Virtual Switch:
In the Virtual Switch Manager window, select "Internal" from the left-hand side.
Click the "Create Virtual Switch" button.
Give your new virtual switch a name, like "Internal Switch."
Click OK to create the internal virtual switch.
4. Configure Virtual Machines:
After creating the virtual switches, you can configure your virtual machines to use them.
Right-click on a virtual machine in Hyper-V Manager and select "Settings."
Under the "Network Adapter" section, select the virtual switch (either external or internal) that you want to connect to your virtual machine.
Click OK to save the settings.
Now, your virtual machines can use these virtual switches for network connectivity. External switches provide connectivity to your physical network, while internal switches create a private network that allows communication between virtual machines and the host, but not to the external network.
Make sure to set up IP addresses and other network configurations within your virtual machines as needed to ensure they can communicate properly on the chosen virtual switch.