03 Host-only network
Two VMs that only the Mac can reach: no NAT, so no internet. Good for anything that must stay offline.
What you practice
- Host mode: a switch with
nat4: falseandnat6: false - The Mac is still a member of the switch and gets its first address
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
a | debian-13 | 1 / 1GiB | lan 10.103.0.11 | Offline VM |
b | debian-13 | 1 / 1GiB | lan 10.103.0.12 | Offline VM |
Before you start
bash
vz image pull disk debian-13Run it
bash
cd examples/03-host-only-network
vz validate
vz up
vz node ls
ssh lab@10.103.0.11 # password: labTry it
bash
ping -c 2 10.103.0.11 # the Mac reaches the VMs
ssh lab@10.103.0.11 'ping -c 2 10.103.0.12' # the VMs reach each other
ssh lab@10.103.0.11 'ping -c 2 -W 2 1.1.1.1' # but not the internetClean up
bash
vz down
vz destroy --yes # deletes the overlays and state of this lab