nym
nym copied to clipboard
Handle Tun device setup error on Linux platforms (nym-node)
Describe the issue
The nym-node binary uses std::process::Command to try to set an IPv6 address for the tun interface used for mixnet traffic. This can silently fail. I am experiencing this while running using a non-root user in a systemd service.
With some extra logging we can see that the command "succeeds" with an Ok() despite having a non-zero error code in the response.
Aug 11 20:44:31 nym-circ-node nym-node[119428]: 2025-08-11T20:44:31.232993Z INFO common/tun/src/linux/tun_device.rs:154: Created TUN device: nymtun0
Aug 11 20:44:31 nym-circ-node nym-node[119428]: 2025-08-11T20:44:31.233039Z INFO common/tun/src/linux/tun_device.rs:164: setting tun IPv6: ""ip" "-6" "addr" "add" "fc00::1/112" "dev" "nymtun0""
Aug 11 20:44:31 nym-circ-node nym-node[119428]: 2025-08-11T20:44:31.236780Z INFO common/tun/src/linux/tun_device.rs:166: tun ipv6 output: Output { status: ExitStatus(unix_wait_status(512)), stdout: "", stderr: "RTNETLINK answers: Operation not permitted\n" }
$ getcap /usr/local/bin/nym-node
/usr/local/bin/nym-node cap_net_bind_service,cap_net_admin=eip
ip_packet_router > nym-tun::new_device_only.
Expected behaviour The result of this operation should be properly checked otherwise it leaves setup incomplete with no indication of what went wrong.
Also the instructions in the Running nym-node as a non-root should be adjusted so that this operation doesn't fail.