Skip to content

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 ​

NodeImageCPUs / memoryAddressesRole
probedebian-131 / 1GiBnat 10.123.0.11; host 10.123.1.11; static 10.123.2.11/24; nodns 10.123.3.11IPv4 features: NAT, host only, no DHCP, no DNS proxy
probe6debian-131 / 1GiBv6 10.123.4.11; quiet 10.123.5.11; jumbo 10.123.6.11IPv6, router advertisements, MTU 9000
peerdebian-131 / 1GiBjumbo 10.123.6.12; v6 10.123.4.12Second end for MTU and IPv6 tests

Before you start ​

bash
vz image pull disk debian-13

Run it ​

bash
cd examples/23-switch-features
vz validate
vz up
vz node ls
ssh lab@10.123.0.11        # password: lab

Try 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.

SwitchFeatureCheckThen flip it
natnat4: true, portForwardingprobe: curl -sI https://deb.debian.org | head -1Remove the forward: ssh -p 2223 lab@localhost stops working
hostonlynat4: false, nat6: falseprobe: ping -I host -c 2 1.1.1.1 fails; ping -c 2 10.123.1.1 (the Mac) worksSet nat4: true
nodhcpdhcp: falseprobe: ip -br addr show static shows only the static addressSet dhcp: true and use DHCP in init/probe/network-config
nodnsdnsProxy: falseprobe: dig @10.123.3.1 debian.org times out; dig @10.123.0.1 debian.org answersSet dnsProxy: true
v6nat6, ipv6Prefix, router advertisementsprobe6: ip -6 -br addr show v6 has an fd00:123:4:: addressRemove nat6 and ipv6Prefix
quietrouterAdvertisement: falseprobe6: ip -6 -br addr show quiet has link-local onlySet routerAdvertisement: true
jumbomtu: 9000probe6: ping -M do -s 8972 -c 2 10.123.6.12Set mtu: 1500 on the switch and in both guests
every switchdhcpReservationsip -br addr shows the reserved addressesRemove 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