Virtual Machine Network Modes
This section describes bridged and host-routed network modes for virtual machines.
Bridged Mode for Virtual Machines
By default, a new virtual machine is created with a network adapter that operates in the bridged mode. The figure below demonstrates an example network configuration where two virtual machines, VM #1 and VM #2, are configured to work in the bridged mode.
In this configuration:
Host-Routed Mode for Virtual Machines
The other network mode a virtual machine can work in is the host-routed mode. The figure below demonstrates an example network configuration where two virtual machines,
VM #1
and
VM #2
, are set to operate in the host-routed mode.
In this configuration:
-
Each virtual machine also has a virtual adapter exposing two interfaces: an
ethX
interface in the virtual machine and a
vmeX
interface on the server.
-
Unlike the bridged mode, the ARP entries for VM #1 and VM #2 are stored on the server rather than in the virtual machines themselves. The server creates these ARP entries and saves them to its ARP table when VM #1 and VM #2 start. You can use the
arp -n
command to view the current ARP entries on a server, for example:
# arp -n
Address HWtype HWaddress Flags Mask Iface
10.30.0.4 ether 00:1a:e2:c7:17:c1 C eth0
10.30.23.162 ether 70:71:bc:42:f6:a0 C eth0
192.168.200.201 * * MP eth0
192.168.200.202 * * MP eth0
-
Along with ARP entries, the server also creates routing entries for both virtual machines. So when the server receives a data packet destined for IP address 192.168.200.201, it knows that the packet must be forwarded to the
vmeXXXXXXXX.0
interface of VM #1.
-
The server handles all incoming traffic for both virtual machines. Consider the following situation:
-
Computer X
on the network wants to send a data packet to VM #1 with IP address 192.168.200.201, so it issues an ARP request which computer has this IP address.
-
The server replies with its own MAC address.
-
Computer X
sends the data packet to the indicated MAC address.
-
The
eth0
physical adapter receives the packet and routes it to the
vme
interface of VM #1.
-
All outgoing network traffic sent from VM #1 and VM #2 are routed through the default gateway to the
eth0
adapter on the server. The default gateway for host-routed virtual machines is automatically assigned the IP address of 169.255.30.1. This special IP address is taken from the Automatic Private IP Addressing (APIPA) range and used exclusively to deliver data packets from virtual machines to the server.
|