Skip to content

tuntun run

Start the TunTun agent. Creates the virtual TUN interface, connects to peers, and begins handling mesh traffic, serves, tunnels, file transfers, and policies.

Usage

bash
sudo tuntun run [options]

Options

OptionEnvDefaultDescription
--ifnameTUNTUN_IFNAMEtuntun0TUN interface name
--poll-secsTUNTUN_POLL_SECS30Snapshot poll interval
--metrics-bindTUNTUN_METRICS_BIND127.0.0.1:9100Prometheus metrics endpoint
--disable-gossipTUNTUN_DISABLE_GOSSIPfalseDisable gossip presence
--recorderTUNTUN_RECORDERfalseEnable SSH session recording

Requirements

The agent needs root/admin privileges to create the TUN interface. On Linux, this means running with sudo. On Windows, run as Administrator with the Wintun driver installed.

Behavior

The agent first loads its persisted identity and state. In managed mode, it connects to the control plane via WebSocket and receives the network snapshot. In direct mode, it joins the iroh-docs membership document and discovers peers via DHT.

It then creates the TUN interface, configures routing and DNS, starts the iroh endpoint, and enters its main event loop - handling packets, maintaining peer connections, and syncing configuration.

Released under the AGPL-3.0 License.