LEEUNITYAssets / Content / 博客.asset
层级
⌄ Lee / Homepage
INSPECTOR
Type
Content
Name
博客
lee@mtftm.com ↗GitHub ↗
N029DEVOPS / DN42 PEER

技术 / English

DN42 Peering Tutorial

DN42 is a large dynamic virtual private network (VPN) that employs various internet technologies (such as BGP…

更新
2025.07.03
阅读
2 分钟
语言
English

Overview

DN42 is a large dynamic virtual private network (VPN) that employs various internet technologies (such as BGP, whois database, DNS, etc.).Participants connect to each other via network tunnels (GRE, OpenVPN, WireGuard, Tinc, IPsec) and exchange routes with the help of the Border Gateway Protocol (BGP).

DN42 can be used to learn about networking and to connect private networks, such as hacker spaces or community networks.But most importantly, experimenting with routing in DN42 is a lot of fun!

Install WireGuard

sudo apt update
sudo apt install wireguard

Create WireGuard Keys

wg genkey | tee privatekey | wg pubkey > publickey

Configure WireGuard Tunnel

# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = xxx
Address = xxx.xxx.xxx/32  # Local tunnel internal address
ListenPort = 51820

[Peer]
PublicKey = xxx
Endpoint = xxx.xxx.xxx:51820
AllowedIPs = xxx/32
PersistentKeepalive = 25

Start/Stop/Reload Configuration

# Start
sudo wg-quick up wg0

# Stop
sudo wg-quick down wg0

# Reload configuration (start then stop)
sudo wg-quick down wg0 && sudo wg-quick up wg0

# View status
sudo wg