Skip to content

Exit node GNU Linux

p1neappleXpress edited this page Sep 18, 2026 · 6 revisions

OpenFlux Exit Node — VPS Deployment Guide

English | Русский

What you get

Linux VPS running an OpenFlux exit node 24/7 with autostart.

Requirements

Item Details
VPS Ubuntu 22.04 / Debian 12 / Fedora / Rocky / Arch
Access Root via SSH
RAM 512 MB min, 1 GB recommended
Traffic 1 TB+ preferred

Choose a provider you trust (Hetzner, Oracle Cloud, Vultr, HostVDS).

Two exit backends

The exit node has exactly two backends, selected with --mode on the exit node (not on the client):

--mode How it forwards Requires Platforms
l3 SNAT/DNAT on raw IPv4 via SOCK_RAW + conntrack. No userspace TCP stack. root / CAP_NET_RAW Linux only
l4 Terminates TCP in a userspace gVisor stack, then net.Dial to the real server. nothing Linux, macOS, Windows

This guide uses l3 (recommended on Linux with root). Use l4 if you cannot run as root.

Step 1 — Connect to your VPS

ssh root@YOUR_SERVER_IP

First connect asks for confirmation — type yes. Prompt changes to root@server-xxxx:~#.

Step 2 — Install packages

Ubuntu / Debian:

apt update && apt upgrade -y
apt install -y git nano curl jq

Fedora / Rocky / Alma:

dnf upgrade -y
dnf install -y git nano curl jq

Arch / Manjaro:

pacman -Syu --noconfirm
pacman -S --noconfirm git nano curl jq

Alpine:

apk update && apk upgrade
apk add git nano curl jq bash

Step 3 — Install Go OR download release binary

Option A — Build from source

Ubuntu / Debian:

apt install -y golang-go

Fedora / Rocky / Alma:

dnf install -y golang

Arch:

pacman -S --noconfirm go

Alpine:

apk add go

Or tarball (all distros):

cd /tmp
curl -LO https://go.dev/dl/go1.22.5.linux-amd64.tar.gz
rm -rf /usr/local/go
tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
go version

ARM64: replace linux-amd64 with linux-arm64.

Option B — Download prebuilt release

List available assets:

curl -s https://api.github.com/repos/p1neappleXpress/OpenFlux/releases/latest | jq -r '.assets[].browser_download_url'

Pick the one matching your CPU (asset names depend on the release; use whatever the jq output shows):

x86_64  ->  openflux-linux-amd64
ARM64   ->  openflux-linux-arm64
ARMv7   ->  openflux-linux-arm
mkdir -p /opt/openflux
cd /opt/openflux
curl -L -o openflux https://github.com/p1neappleXpress/OpenFlux/releases/latest/download/openflux-linux-amd64
chmod +x openflux
./openflux

If the usage text appears — the binary works.

If using Option B, replace /root/OpenFlux/openflux with /opt/openflux/openflux in the systemd unit below.

Step 4 — Get OpenFlux (Option A only)

cd /root
git clone https://github.com/p1neappleXpress/OpenFlux.git
cd OpenFlux
go build -o openflux .

Step 5 — Block kernel RST packets

In l3 mode the kernel sees return packets for connections it never opened and emits RSTs, tearing tunnel connections down. Drop them.

Scoped (recommended) — assign a dedicated egress IP, run the exit with --local-ip, then:

iptables -A OUTPUT -p tcp --tcp-flags RST RST -s YOUR_EGRESS_IP -j DROP

Host-wide fallback (drops ALL outbound RST; closed ports then look filtered):

iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP

nftables alternative:

nft add rule inet filter output tcp flags rst drop

The L3 code already drops client-originated RSTs before sendto(), so the rule above is only needed for kernel-generated RSTs.

Step 6 — Pick a transport

OpenFlux ships five transports. All of them run over the same tunnel; pick the one whose provider you trust.

--transport What it uses URL / credentials
yandex Yandex.Docs over WebSocket Public Yandex.Docs spreadsheet URL
vyandex Yandex.Volga over HTTP relay + WS Yandex.Volga document URL
oneme MAX (VK) over WebRTC DataChannel Requires --maxToken and --maxUid
cupsonline Cups.online Centrifugo rooms No URL — the exit prints a base64 room list; pass it to the client via --url
mailru Mail.ru Docs over WebSocket Public Mail.ru cloud link

This guide uses yandex as the default. Replace --transport=yandex with any of the above.

Yandex.Docs setup:

  1. Go to https://docs.yandex.ru/
  2. Turn off "Try the new editor" — use legacy editor
  3. Create a spreadsheet
  4. Share -> public by link
  5. Copy URL: https://disk.yandex.ru/i/XXXXXXXXXXXXXXXX

Mail.ru setup:

  1. Upload a document to cloud.mail.ru
  2. Share -> public by link
  3. Pass either the bare weblink (AbCdEfGh1/IjKlMnOp2) or the full URL (https://cloud.mail.ru/public/AbCdEfGh1/IjKlMnOp2)

Step 7 — Test manually

sudo ./openflux --role=exit --mode=l3 \
    --transport=yandex \
    --url="https://disk.yandex.ru/i/YOUR_URL"

Press Ctrl+C to stop.

Step 8 — Systemd service (24/7)

nano /etc/systemd/system/openflux.service

Paste (Option A — built from source):

[Unit]
Description=OpenFlux exit node
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root/OpenFlux
ExecStartPre=/usr/sbin/iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP
ExecStart=/root/OpenFlux/openflux --role=exit --mode=l3 --transport=yandex --url="YOUR_YANDEX_URL"
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Option B (from release):

[Unit]
Description=OpenFlux exit node
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/openflux
ExecStartPre=/usr/sbin/iptables -A OUTPUT -p tcp --tcp-flags RST RST -j DROP
ExecStart=/opt/openflux/openflux --role=exit --mode=l3 --transport=yandex --url="YOUR_YANDEX_URL"
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Note: no --debug in the service. --debug adds per-packet logging (fmt.Sprintf + I/O on every packet), which can eat more CPU than the L3 forwarder itself at high throughput. Enable it only while troubleshooting.

Save: Ctrl+O, Enter, Ctrl+X.

Enable and start:

systemctl daemon-reload
systemctl enable openflux.service
systemctl start openflux.service

Step 9 — Verify

systemctl status openflux.service

Look for green active (running) and:

=== OpenFlux ===

Live logs:

journalctl -u openflux.service -f

Step 10 — Connect a client

macOS (utun, default):

sudo ./openflux --role=client --inbound=tun \
    --transport=yandex \
    --url="YOUR_YANDEX_URL"

Linux / Windows (SOCKS5):

./openflux --role=client --inbound=socks5 \
    --transport=yandex \
    --url="YOUR_YANDEX_URL" \
    --socks5=:1080

Then point your browser / app at 127.0.0.1:1080 as a SOCKS5 proxy.

Android: download from https://github.com/p1neappleXpress/OpenFluxAndroid/releases

First connections may hang ~5 minutes.

Important: client and exit must use the same transport AND the same codec. Default codec is batched (zstd + coalescing). If you are using an older client, add --codec=legacy to BOTH sides.

Useful commands

Status:  systemctl status openflux
Logs:    journalctl -u openflux -f
Restart: systemctl restart openflux
Stop:    systemctl stop openflux
Disable: systemctl disable openflux
Edit:    nano /etc/systemd/system/openflux.service
Reload:  systemctl daemon-reload && systemctl restart openflux

Troubleshooting

Service fails with "no such file or directory":

ls -la /root/OpenFlux/openflux

Service runs but clients cannot connect:

iptables -L OUTPUT -n -v | grep RST

operation not permitted in the log:

  • Kernel RSTs are reaching sendto(). Install the iptables rule from Step 5.
  • Also check you are not running with --debug (it masks the real cause and eats CPU).

Yandex.Docs errors:

  • Document must be public and in the legacy editor ("Try the new editor" off).

Mail.ru errors:

  • Link must be public; either bare weblink or full cloud.mail.ru URL.

High CPU / traffic:

  • Remove --debug, monitor with top and iftop.

Optional Step — SSH key and security

WARNING: Without this your VPS is a target. Bots scan 24/7 and brute-force root passwords. If you skip this, use a strong random password.

Generate SSH key on your PC.

Windows (PowerShell):

ssh-keygen -t ed25519
type $env:USERPROFILE\.ssh\id_ed25519.pub

macOS / Linux:

ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519.pub

Press Enter twice. Copy the output.

Add key to VPS:

mkdir -p ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys

Paste the key. Save Ctrl+O, Enter, Ctrl+X.

chmod 600 ~/.ssh/authorized_keys

Test the key — new terminal:

ssh root@YOUR_SERVER_IP

If no password asked — key works.

Disable password login (only after the key works):

nano /etc/ssh/sshd_config

Set:

PasswordAuthentication no
PubkeyAuthentication yes
ChallengeResponseAuthentication no
PermitRootLogin prohibit-password

Restart SSH.

Ubuntu / Debian:

systemctl restart ssh

Fedora / Rocky / Alma / Arch:

systemctl restart sshd

WARNING: Keep the current session open. Test from a second terminal. If something breaks, use the provider web console (KVM/VNC) to set PasswordAuthentication yes, restart SSH, and try again.

Recommendation

Enable SSH key auth and disable password login. 5-minute setup removes 99% of automated attacks.

thank you: restricted, Vladislav Zamchenko

Clone this wiki locally