VM Networking Basics
What You'll Learn
You'll discover how virtual machines connect to networks using private IP addresses and how they can optionally receive public IPs for internet access.
How VMs Connect to Networks
When you launch a virtual machine, it doesn't exist in isolation—it needs to communicate with other resources, services, and potentially the internet. Think of VM networking like connecting a computer to your home network: it gets an internal address for local communication and optionally a public address for internet access.
Private IP Addresses
Every VM receives a private IP address from a virtual network (sometimes called a VPC or VNet). This IP comes from a private address range (like 10.0.0.0/16 or 172.16.0.0/16) and allows:
- Communication with other VMs in the same virtual network
- Access to internal services and databases
- Secure, isolated connectivity that isn't exposed to the internet
These addresses are like internal office extensions—they work within your organization but can't be dialed from outside.
Public IP Addresses (Optional)
If your VM needs internet access or must be reachable from outside the cloud, you can assign a public IP address. This globally routable address allows:
- Inbound connections from the internet (like SSH or RDP sessions)
- Outbound internet connectivity from the VM
- Hosting web servers or APIs accessible to users
Not all VMs need public IPs. Backend databases, internal processing servers, and many workloads operate perfectly with only private addresses, reducing security exposure.
The Connection Flow
Your VM connects to a virtual network interface (like a virtual network card), which attaches to a subnet within your virtual network. The subnet provides the private IP, and the public IP (if configured) gets mapped to that private address through network address translation.
Key Takeaway: VMs always receive private IP addresses for internal communication within your virtual network, and you can optionally assign public IPs when internet connectivity is required.