Skip to content

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: mac in network-config)
  • Measuring VM-to-VM bandwidth

Topology ​

NodeImageCPUs / memoryAddressesRole
vm1debian-131 / 1GiBmgmt 10.102.0.11Talks to vm2
vm2debian-131 / 1GiBmgmt 10.102.0.12Talks to vm1

Before you start ​

bash
vz image pull disk debian-13

Run it ​

bash
cd examples/02-two-vms
vz validate
vz up
vz node ls
ssh lab@10.102.0.11        # password: lab

First 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/mgmt

Clean up ​

bash
vz down
vz destroy --yes   # deletes the overlays and state of this lab