Virtual Switches and Networks
Learn how virtual networking connects VMs without physical cables.
Virtual Switches and Networks is a free Network+ Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Network+ Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Networking Inside the Host
When many VMs live on one physical server, they still need to talk to each other and the outside world. A virtual switch (vSwitch) is software inside the hypervisor that does the job of a physical switch, but for virtual machines.
It forwards Ethernet frames between VMs and out through the host physical network cards, so the network now reaches inside the server itself.
What a Virtual NIC Is
Each VM is given one or more virtual NICs (virtual network interface cards). To the guest OS, a vNIC looks exactly like a real Ethernet adapter with its own MAC address (Media Access Control hardware address).
The vNIC connects to a port on the virtual switch. From there the hypervisor decides whether traffic stays inside the host or exits onto the physical LAN.
How a vSwitch Forwards Traffic
A virtual switch works like its physical cousin: it learns which MAC address sits on which virtual port and forwards frames only where they belong. Traffic between two VMs on the same host never touches a physical cable, so it is extremely fast.
When a VM needs to reach a different host or the internet, the vSwitch sends the frame out through an uplink, the host real network adapter.
Uplinks to the Physical World
An uplink is the physical NIC on the host that connects the virtual switch to the real network. You can bind several physical NICs to one vSwitch for more bandwidth and redundancy, a technique called NIC teaming or link aggregation.
If one uplink cable fails, the others keep the VMs online. Without an uplink, a vSwitch becomes isolated and VMs can only talk among themselves.
Virtual VLANs
Virtual switches support VLANs (Virtual Local Area Networks) just like hardware switches. You can place VMs into separate VLANs so, for example, web servers and database servers are isolated even on the same host.
The vSwitch tags frames with VLAN IDs and passes them over a trunk uplink to the physical network, keeping segmentation consistent from the virtual world to the physical one.
Internal vs External Networks
Hypervisors offer several vSwitch connection modes:
- External: bound to a physical NIC, so VMs reach the LAN and internet.
- Internal: VMs talk to each other and the host, but not the outside network.
- Private: VMs talk only to each other, fully isolated even from the host.
Choosing the right mode controls exactly how far a VM traffic can travel.
NAT Networking for VMs
Many desktop hypervisors offer a NAT (Network Address Translation) mode. The VMs sit on a private virtual network and share the host single IP address to reach the internet, just like home devices share one public address.
NAT is convenient for labs because VMs get internet access without needing their own address on the real LAN, but inbound connections require port forwarding.
Distributed Virtual Switches
In large data centers, a distributed virtual switch spans many physical hosts and is managed as one logical switch. VMware vDS and similar tools let admins configure network policy once and apply it everywhere.
This keeps settings consistent when a VM live-migrates between hosts, since the network configuration follows the VM automatically rather than being set per host.
Software-Defined Networking
SDN (Software-Defined Networking) separates the control plane (decisions about where traffic goes) from the data plane (actual forwarding). A central controller programs the network through software, making it flexible and automated.
Virtual switches are a natural fit for SDN: the entire network can be defined, changed, and scaled in code rather than by plugging cables, which is essential at cloud scale.
Why This Matters for Techs
Modern troubleshooting often ends inside a host. A VM with no connectivity might have its vNIC attached to the wrong vSwitch, the wrong VLAN, or an uplink that is down. Understanding the virtual layer saves hours of chasing physical cables that are fine.
The same concepts (switches, VLANs, MAC addresses) apply, just implemented in software within the hypervisor.
Putting It Together
A VM vNIC plugs into a vSwitch port; the vSwitch forwards local traffic instantly and sends external traffic out an uplink to the physical LAN, optionally tagged with a VLAN. Choosing external, internal, private, or NAT modes controls reach, and distributed switches plus SDN scale this design across whole data centers.
Quick Check
Test your understanding of virtual networking modes.
Recap
A virtual switch forwards frames between VMs using their virtual NICs and connects to the physical network through an uplink. vSwitches support VLANs and offer external, internal, private, and NAT modes to control reach. Distributed switches and SDN scale this design across data centers, so network troubleshooting now extends inside the host.
Frequently asked questions
Is the “Virtual Switches and Networks” lesson free?
Yes — the full text of “Virtual Switches and Networks” is free to read here on the web, and the Network+ Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Network+ Academy course, upgrade to CoddyKit PRO.
What will I learn in “Virtual Switches and Networks”?
Learn how virtual networking connects VMs without physical cables. You practise Network+ Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Network+ Academy?
No prior experience is required. Network+ Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Virtual Switches and Networks” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Network+ Academy lesson?
Yes. Every Network+ Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Virtual Machines and Hypervisors
- Virtual Switches and Networks
- Public, Private, and Hybrid Cloud
- Cloud Connectivity and VPCs