Definition and intuition

A virtual NIC needs a connection to other machines. A Linux bridge forwards Ethernet frames like a switch; routing forwards IP packets between networks; NAT additionally translates addresses and usually transport ports. A host can combine these roles.

Compare the arrangements

ArrangementTypical guest placementExternal communication
NATSeparate private subnetHost routes/translates outgoing traffic; replies follow connection tracking
RoutedSeparate subnetHost forwards without translating addresses; outside routers need a return path
BridgedSame LAN as physical peersBridge connects the guest interface to that LAN
IsolatedPrivate virtual networkNo configured external forwarding path; guest/host communication can remain available

These describe configured connectivity, not universal security guarantees. Firewall rules and actual routing still matter.

Added packet example

Guest 192.168.100.10 reaches a server through a host whose outward address is 192.168.1.20. With NAT, the host substitutes its outward source address, usually also translating a port, and tracks the connection to deliver replies to the guest. Unsolicited inbound traffic normally requires explicit forwarding or another access mechanism.

With routed forwarding, the guest’s source address is preserved. An upstream router needs a route for 192.168.100.0/24 through the host, and the wider path must support the addresses used. Sending an outbound packet does not establish that return route automatically.

In bridged mode, the guest generally appears as another machine on the connected LAN. In isolated mode, VMs can communicate internally and potentially with the host, but there is no configured forwarding path outside that network.

Supporting components

  • DHCP: assigns IP configuration.
  • DNS: resolves names.
  • dnsmasq: can supply DHCP and DNS services.
  • TAP: host virtual Ethernet interface used by networking backends.
  • Bridge: connects Ethernet interfaces.
  • Routing/NAT/firewall: controls movement between networks.

The host’s own applications continue to use its ordinary network stack. Libvirt’s default NAT network is one setup; it is not a statement that every QEMU networking backend uses NAT.

Common mistakes

  • Treating bridging and routing as the same layer of forwarding.
  • Assuming all private guest networks use NAT.
  • Forgetting the return route in routed mode.
  • Calling an isolated network a guarantee against every possible host-mediated connection.
  • Confusing guest network reachability with the Virtio device protocol used to send packets.

Source

Lecture 05 - Computing Virtualization in Linux, shared teaching explanation for printed slides 25-27. Examples and qualifications are study additions; no network was configured or tested for these notes.

Connection to process isolation

Network Namespaces and Veth Pairs develops the separate network stacks and veth links behind process-based environments. A VM’s guest-facing NIC and a container’s namespace interface are different objects, but their outside connectivity can use the same Linux bridge/routing/NAT ideas. Pairing, interface state and return routes remain separate checks.