02 Two VMs on one switch
Two Debian VMs on one NAT switch with fixed addresses, so they can reach each other and the internet.
What you practice
- DHCP reservations: fixed addresses by MAC
- Why the guest must send its MAC as DHCP client id (
dhcp-identifier: macinnetwork-config) - Measuring VM-to-VM bandwidth
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
vm1 | debian-13 | 1 / 1GiB | mgmt 10.102.0.11 | Talks to vm2 |
vm2 | debian-13 | 1 / 1GiB | mgmt 10.102.0.12 | Talks to vm1 |
Before you start
bash
vz image pull disk debian-13Run it
bash
cd examples/02-two-vms
vz validate
vz up
vz node ls
ssh lab@10.102.0.11 # password: labFirst boot installs packages; give it a minute or two after vz up returns.
Try it
bash
ssh lab@10.102.0.12 'iperf3 -s -D' # start a server on vm2
ssh lab@10.102.0.11 'iperf3 -c 10.102.0.12 -t 5'
vz port down vm2/mgmt # unplug vm2's cable
ssh lab@10.102.0.11 'ping -c 2 10.102.0.12' # fails
vz port up vm2/mgmtClean up
bash
vz down
vz destroy --yes # deletes the overlays and state of this lab