container-test-run-user-firewall-nftables
default.checks.aarch64-linux.nixos-test-user-firewall-nftables
· build #311
· raw
1additionally exposed symbols:2 machine, router,3 start_all, machines, driver, Machine, wait_for_signal4Starting machine5Starting router67891011<<< NixOS Stage 2 >>>1213booting system configuration /nix/store/a1ggvb5mv95l8b5hz9v4mgrbnka4mdam-nixos-system-machine-test14running activation script...15setting up /etc...162: host0@if3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100017 link/ether 0e:74:26:22:81:c2 brd ff:ff:ff:ff:ff:ff link-netnsid 018starting systemd...19systemd 261.1 running in system mode (+PAM +AUDIT -SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK -BTF -XKBCOMMON +UTMP +LIBARCHIVE)20Detected virtualization systemd-nspawn.21Detected architecture arm64.22Detected first boot.23Initializing machine ID from container UUID.24Applying preset policy.25Populated /etc with preset unit settings.26Queued start job for default target Multi-User System.27282930<<< Welcome to NixOS test (aarch64) - console >>>31+ systemd-run /bin/sh -c '/nix/store/p79fmimbb698sv4c135kbdwlhjcqpd3p-coreutils-9.11/bin/sleep 999999999 && echo c0a3ccb6-a268-4121-8159-9e8494b28c98'32Running as unit: run-p227-i84215833.service; invocation ID: 2418e2103b0e49feb151d7c85480313f33To attach to container machine run on the same machine that runs the test:34 sudo nsenter --user --target $(\pgrep -f '^/bin/sh.*c0a3ccb6-a268-4121-8159-9e8494b28c98') --mount --uts --ipc --net --pid --cgroup /bin/sh -c bash 3536To inject external network and continue test, run:37sudo /nix/store/41m77i1296n33p6liin8ynr6wh3h6b7m-python3-3.14.6/bin/python3.14 /nix/store/fz2xjd9j3lyn06n25cxv0zl74vhk4f32-test-driver-0.0.1/lib/python3.14/site-packages/test_driver/inject_network.py c0a3ccb6-a268-4121-8159-9e8494b28c983839<<< NixOS Stage 2 >>>4041booting system configuration /nix/store/8a19k4mj7d0vcggba9wv8pj1y42ggf1r-nixos-system-router-test42running activation script...43setting up /etc...442: host0@if4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100045 link/ether a6:24:31:fe:b9:6d brd ff:ff:ff:ff:ff:ff link-netnsid 046starting systemd...47systemd 261.1 running in system mode (+PAM +AUDIT -SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK -BTF -XKBCOMMON +UTMP +LIBARCHIVE)48Detected virtualization systemd-nspawn.49Detected architecture arm64.50Detected first boot.51Initializing machine ID from container UUID.52Applying preset policy.53Populated /etc with preset unit settings.54Queued start job for default target Multi-User System.55565758<<< Welcome to NixOS test (aarch64) - console >>>59+ systemd-run /bin/sh -c '/nix/store/p79fmimbb698sv4c135kbdwlhjcqpd3p-coreutils-9.11/bin/sleep 999999999 && echo c5dd8d2f-a062-4b86-821b-ff961c90a3e3'60Running as unit: run-p210-i84215842.service; invocation ID: c1abdbebe4f54f6aa8e70824e35435bb61To attach to container router run on the same machine that runs the test:62 sudo nsenter --user --target $(\pgrep -f '^/bin/sh.*c5dd8d2f-a062-4b86-821b-ff961c90a3e3') --mount --uts --ipc --net --pid --cgroup /bin/sh -c bash 6364To inject external network and continue test, run:65sudo /nix/store/41m77i1296n33p6liin8ynr6wh3h6b7m-python3-3.14.6/bin/python3.14 /nix/store/fz2xjd9j3lyn06n25cxv0zl74vhk4f32-test-driver-0.0.1/lib/python3.14/site-packages/test_driver/inject_network.py c5dd8d2f-a062-4b86-821b-ff961c90a3e366+ systemctl --no-pager show multi-user.target67+ systemctl --no-pager show nginx.service68+ systemctl --no-pager show multi-user.target69+ systemctl --no-pager show nginx.service70+ ip -4 addr show eth171+ grep -oP '(?<=inet\s)\d+(\.\d+){3}'72+ ip -6 addr show eth173+ grep -oP '(?<=inet6\s)[0-9a-f:]+'74+ grep -v '^fe80'75+ head -176Router IPv4: 192.168.1.277Router IPv6: 2001:db8:1::278+ systemctl restart nftables79+ systemctl --no-pager show nftables.service80+ nft list table inet user-firewall81table inet user-firewall {82 chain output {83 type filter hook output priority filter; policy accept;84 oifname "lo" counter packets 0 bytes 0 accept comment "allow lo"85 oifname "tun*" counter packets 0 bytes 0 accept comment "allow tun*"86 oifname "tap*" counter packets 0 bytes 0 accept comment "allow tap*"87 oifname "wg*" counter packets 0 bytes 0 accept comment "allow wg*"88 oifname "tailscale*" counter packets 0 bytes 0 accept comment "allow tailscale*"89 oifname "zt*" counter packets 0 bytes 0 accept comment "allow zt*"90 oifname "vpn*" counter packets 0 bytes 0 accept comment "allow vpn*"91 oifname "ipsec*" counter packets 0 bytes 0 accept comment "allow ipsec*"92 oifname "nebula*" counter packets 0 bytes 0 accept comment "allow nebula*"93 oifname "tinc*" counter packets 0 bytes 0 accept comment "allow tinc*"94 oifname "edge*" counter packets 0 bytes 0 accept comment "allow edge*"95 oifname "hyprspace" counter packets 0 bytes 0 accept comment "allow hyprspace"96 oifname "ham0" counter packets 0 bytes 0 accept comment "allow ham0"97 oifname "easytier" counter packets 0 bytes 0 accept comment "allow easytier"98 oifname "mycelium" counter packets 0 bytes 0 accept comment "allow mycelium"99 meta skuid 1002 counter packets 0 bytes 0 reject comment "blocked user bob"100 }101}102machine: waiting for success: runuser -u alice -- curl -s http://127.0.0.1:8080103+ runuser -u alice -- curl -s http://127.0.0.1:8080104(finished: waiting for success: runuser -u alice -- curl -s http://127.0.0.1:8080, in 0.02 seconds)105+ runuser -u alice -- curl -s http://192.168.1.2106+ runuser -u alice -- curl -s 'http://[2001:db8:1::2]'107+ runuser -u bob -- curl -s http://127.0.0.1:8080108+ runuser -u bob -- curl -s --connect-timeout 2 http://192.168.1.2109+ echo EXIT_CODE=7110+ runuser -u bob -- curl -s --connect-timeout 2 'http://[2001:db8:1::2]'111+ echo EXIT_CODE=7112+ nft list table inet user-firewall113+ systemctl --no-pager show setup-wg0-interface.service114+ systemctl --no-pager show nginx.service115machine: waiting for success: nc -z 10.100.0.2 8081116+ nc -z 10.100.0.2 8081117Connection to 10.100.0.2 8081 port [tcp/sunproxyadmin] succeeded!118(finished: waiting for success: nc -z 10.100.0.2 8081, in 0.01 seconds)119+ ip link show wg0120+ ip addr show wg0121+ runuser -u alice -- curl -s --interface wg0 http://10.100.0.2:8081/122+ runuser -u alice -- curl -s --interface wg0 'http://[fd00::2]:8081/'123+ runuser -u bob -- curl -s --interface wg0 http://10.100.0.2:8081/124+ runuser -u bob -- curl -s --interface wg0 'http://[fd00::2]:8081/'125+ nft list table inet user-firewall126+ grep -E 'oifname.*wg'127 oifname "wg*" counter packets 1 bytes 56 accept comment "allow wg*"128129