#!/bin/bash
set -euo pipefail
# Run on Linux with systemd-networkd's default container-ve configuration.
# The client connects over an existing LAN address, 192.168.122.39.
sudo ip netns add t3proof32140
sudo ip link add ve-proof32140 type veth peer name host0 netns t3proof32140
sudo ip addr add 192.168.60.81/28 dev ve-proof32140
sudo ip link set ve-proof32140 up
sudo ip netns exec t3proof32140 ip link set host0 up
# networkd replaces the initial address with its own /28 and a link-local address.
# The scenario reads the resulting private IPv4 from the real interface.
networkctl status ve-proof32140 --no-pager
# After the proof: sudo ip link del ve-proof32140; sudo ip netns del t3proof32140
