Lab · reference
What runs as root
Only one script of the lab uses sudo: lab/net.sh.
QEMU, the simulated fleet and kind run as your user.
At a glance
Section titled “At a glance”- Script
lab/net.sh- Called by
- mise run lab:up, mise run lab:down and mise run lab:collect (status only)
- Commands as root
ip,iptables,sysctl,nft(read only),firewall-cmd- Mark
pk-metal-lab, as the alias of each interface and the comment of each rule.- Files in
/etc - None.
- After a reboot
- No change stays.
What it changes
Section titled “What it changes”| Change | Made by up |
Removed by down |
|---|---|---|
Bridge pkbr0 with 10.77.0.1/24 |
Yes | Yes, if it has the mark |
| One tap for each machine, owned by you | Yes | Yes, if it has the mark |
net.ipv4.ip_forward=1 |
Only if it was off | Only if up turned it on |
iptables rules with the comment pk-metal-lab |
Yes | Yes |
pkbr0 in the firewalld zone trusted (runtime) |
Only with firewalld |
Yes |
The rules are in firewall rules.
down removes only the things that have the mark.
If a bridge or a tap with the same name has no mark, the script does not touch it. It tells you.
The script records in /run/pk-metal-lab if it turned IPv4 forwarding on.
What does not run as root
Section titled “What does not run as root”| Part | Runs as | Reason |
|---|---|---|
| QEMU virtual machines | You | You own the taps, and /dev/kvm is usable by your user. |
| Simulated fleet | You | It listens on ports above 1024. |
| kind, kubectl, pk-metal | You | They speak to the Docker daemon and to the cluster. |
| Docker daemon | root | It is the service of the system. The lab does not start it. |
Read before you run
Section titled “Read before you run”-
Read the script. It is short.
Terminal window less lab/net.sh -
Show what exists now. This command changes nothing.
Terminal window lab/net.sh status -
For
sudowithout a password, add onlyip,iptables,sysctl,nftandfirewall-cmdto thesudorules.
Who can get to the lab services
Section titled “Who can get to the lab services”The simulated BMCs and the media port listen on 10.77.0.1 only.
The firewall rules accept input to that address from the lab bridge and from the Docker bridges only.
The network of the workstation cannot get to them.