23 Switch feature tour
Seven switches, each showing one switch feature, explored from two probe VMs and a peer.
What you practice
- Every switch key:
nat4,nat6,ipv6Prefix,mtu,dhcp,dhcpReservations,dnsProxy,routerAdvertisement,portForwarding - What the guest sees when each one is on or off
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
probe | debian-13 | 1 / 1GiB | nat 10.123.0.11; host 10.123.1.11; static 10.123.2.11/24; nodns 10.123.3.11 | IPv4 features: NAT, host only, no DHCP, no DNS proxy |
probe6 | debian-13 | 1 / 1GiB | v6 10.123.4.11; quiet 10.123.5.11; jumbo 10.123.6.11 | IPv6, router advertisements, MTU 9000 |
peer | debian-13 | 1 / 1GiB | jumbo 10.123.6.12; v6 10.123.4.12 | Second end for MTU and IPv6 tests |
Before you start
bash
vz image pull disk debian-13Run it
bash
cd examples/23-switch-features
vz validate
vz up
vz node ls
ssh lab@10.123.0.11 # password: labTry it
Log in to probe with ssh lab@10.123.0.11 (or ssh -p 2223 lab@localhost, the port forward) and to probe6 with ssh lab@10.123.4.11.
| Switch | Feature | Check | Then flip it |
|---|---|---|---|
nat | nat4: true, portForwarding | probe: curl -sI https://deb.debian.org | head -1 | Remove the forward: ssh -p 2223 lab@localhost stops working |
hostonly | nat4: false, nat6: false | probe: ping -I host -c 2 1.1.1.1 fails; ping -c 2 10.123.1.1 (the Mac) works | Set nat4: true |
nodhcp | dhcp: false | probe: ip -br addr show static shows only the static address | Set dhcp: true and use DHCP in init/probe/network-config |
nodns | dnsProxy: false | probe: dig @10.123.3.1 debian.org times out; dig @10.123.0.1 debian.org answers | Set dnsProxy: true |
v6 | nat6, ipv6Prefix, router advertisements | probe6: ip -6 -br addr show v6 has an fd00:123:4:: address | Remove nat6 and ipv6Prefix |
quiet | routerAdvertisement: false | probe6: ip -6 -br addr show quiet has link-local only | Set routerAdvertisement: true |
jumbo | mtu: 9000 | probe6: ping -M do -s 8972 -c 2 10.123.6.12 | Set mtu: 1500 on the switch and in both guests |
| every switch | dhcpReservations | ip -br addr shows the reserved addresses | Remove a reservation: a random address |
Changes to lab.yaml apply on the next start: vz down && vz up.
Notes
The Mac is a member of every switch and has the first address on each (10.123.X.1). vmnet allows at most 4 switch NICs per VM, hence two probes. In each probe only one NIC installs a default route; the others ignore the DHCP router option (use-routes: false in network-config), so every test uses its own NIC.
Clean up
bash
vz down
vz destroy --yes # deletes the overlays and state of this lab