"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.- Dr. Seuss"
In my previous post, we have seen the basic of "PowerShell and Hyper-V". That shows how to install Hyper-V and how to get the list of all virtual machines (those were pre-created).
Today, we are going create a new virtual switch.
What is a virtual switch?
In a simple language, it is virtual switch is virtual like virtual machines. Our Virtual machines need to connect with either each other, or with our physical machines, By using virtual switch, we can create a LAN environment. We can created multiple LAN environment using these Virtual switches.
There are 3 types of virtual switches.
In external switch, our virtual machine is able to talk with all of resources available on our physical network.Internal :
Using internal switch, our virtual machine is only able to talk with the host and other virtual machines.Private:
Private switch allow communication between the virtual machines on the host that's all.Let's get started.
I am going to create a new External virtual switch.
Hyper-V external virtual switches are bind on the physical lan/wifi adapter by which they can connected to physical environment.
To get the list of all network adapters we can use Get-NetAdapter cmdlet.
I am connected to my physical network using my LAN card named as "Ethernet". I will bind "Virtual External Switch" on "Ethernet" lan.
To create a new virtual switch we use New-VMSwitch cmdlet.
To list all of your Virtual switches, use the cmdlet,Get-VMSwitch
You can see that, currently, there is no virtual switch which is connected to External network.,
Creating external switch is simple. We just need to name of the External virtual swtich, and then name of our LAN/WiFI adapter name and that's all.
The command is :
New-VMSwitch -Name "Connect_toThe_World" -NetAdapterName 'Ethernet' -AllowManagementOS $true
And you can see that , new External Switch is created.
If you want to create an internal or private switch, you mainly need two parameters with New-VMSwitch cmdlet, -Name and -SwitchType
Creating Internal virtual switch.
New-VMSwitch -Name "my_lonely_world" -SwitchType Internal
Creating Private virtual switch.
New-VMSwitch -Name "I_M_Secret" -SwitchType Private
and you can see the list of all virtual switches.
That's all for now See you in my next blog posts.