TUN to UDP tunnel (optimized)
This setup connects two nodes with a TUN interface on each, so IP traffic can pass between them. The traffic is carried by Raft, NanoPing's transport protocol, over two carriers. Raft's realtime stream gives the tunnel:
- A latency budget: packets older than the stream's timeout are dropped instead of delivered late.
- Adaptive FEC and retransmissions: lost packets are repaired within the budget whenever possible.
- Multiple carriers: traffic is spread over several network interfaces, so the tunnel survives when one of them fails. This setup uses two, but Raft can use as many as the node has.
The VPN Tunnel template sets up the same kind of tunnel for you. Use the files below when you want to start from a known pipeline and edit it yourself.
Requirements
- Two nodes, a client and a server, that can reach each other.
- NanoPing running as root on both (
sudo np up), or on Linux with the capabilities to create a TUN interface.
Once the client has sent its first packet, traffic flows both ways.
Client pipeline

The client reads packets from tun0 (10.0.0.1) and sends them through Raft to the server over two carriers, one per Peer Writer.
- Download the client pipeline.
- On the client node, open Pipelines, click Add, choose From File and upload the file.
- In each Peer Writer, set Remote Address to the server's address and port. For the best result, send each carrier over a different network interface.
Server pipeline

The server receives the carriers on two UDP Local components and delivers the packets to tun1 (10.0.0.2).
- Download the server pipeline.
- On the server node, open Pipelines, click Add, choose From File and upload the file.
- In each UDP Local, set Address to the address and port the server listens on.
0.0.0.0listens on every interface.
Start the server pipeline, then the client pipeline.
These pipelines do not encrypt or authenticate the traffic. Use them for testing and evaluation only.
Next steps
- Check the tunnel with ping or iperf3.
- Route other traffic through it with iptables.
- Compare it with the unoptimized tunnel to see what Raft adds.