Skip to content

Getting Started

This guide will walk you through setting up a basic Nylon network with two nodes.

graph LR
    node1(node-1<br/>10.0.0.1) <--> node2(node-2<br/>10.0.0.2)
  • Two machines (Linux or macOS) with UDP port 57175 open.
  • The nylon binary installed on both machines.

On each node, generate a WireGuard keypair:

Terminal window
nylon key
  • Stdout: Your private key (keep this safe).
  • Stderr: Your public key (you’ll need this for the central config).

On each node, create a node.yaml file. Replace <YOUR_PRIVATE_KEY> with the private key generated in step 1.

id: node-1 # Give each node a unique ID (e.g., node-1, node-2)
key: <YOUR_PRIVATE_KEY>
port: 57175

The central.yaml file defines the topology of your network. Create one file and share it across all nodes.

routers:
- id: node-1
pubkey: <NODE_1_PUBLIC_KEY>
endpoints:
- "node1.example.com:57175"
addresses:
- 10.0.0.1
- id: node-2
pubkey: <NODE_2_PUBLIC_KEY>
endpoints:
- "node2.example.com:57175"
addresses:
- 10.0.0.2
# Define the connections between nodes
graph:
- "node-1, node-2"

Run Nylon on both machines:

Terminal window
sudo nylon run -c central.yaml -n node.yaml

After a few seconds, the nodes will discover each other and establish a secure tunnel. You should be able to ping 10.0.0.2 from node-1.