Transparent per-app VPN bypass on Linux.
Your VPN hijacks all routes. Some apps need to go around it.
byway is a Go daemon that uses cgroup v2 + nftables + policy routing to transparently route traffic from specific apps through a different network interface. No wrappers, no namespaces β apps launch normally.
App in config βββΊ cgroup βββΊ fwmark βββΊ policy route βββΊ direct interface βββΊ π
Everything else βββΊ default route βββΊ VPN tunnel βββΊ π
- π¦ cgroup v2 β groups configured app processes
- π·οΈ nftables β marks packets from that cgroup with a fwmark
- π policy routing β routes marked packets through your chosen interface
- π proc connector β watches for new processes matching your config
- π reconciler β periodically verifies and restores rules if anything flushes them
cp example.toml byway.toml
# edit byway.toml with your interface and appsinterface = "wwan0"
reconcile = "5s"
apps = [
"/usr/bin/firefox",
"/usr/bin/curl",
]- π§ Linux with cgroup v2 (unified hierarchy) β default on Ubuntu 22.04+
- π₯ nftables kernel support β default on all modern kernels (5.x+)
- π A second network interface for bypass traffic (or shared mode with the VPN interface)
- π¨ Go 1.23+ to build
No userspace tools needed at runtime β byway talks directly to the kernel via netlink.
go build -o byway .
sudo ./byway -config byway.tomlRuns as root (required for cgroup, nftables, netlink, ip rule).
| Mode | Example | Reliability |
|---|---|---|
| π’ Dedicated | wwan0, eth1, usb0 |
High β separate physical path |
| π‘ Shared | wlan0 (same as VPN) |
Best-effort β reconciler mitigates rule flushes |
- Start β detect gateway, create cgroup, nftables rule, ip rule + route table
- Run β three concurrent loops: config watcher ποΈ, process monitor π, reconciler π
- Hot-reload β edit
byway.tomlwhile running β app list, interface, and reconcile interval update live - Stop β
Ctrl+Ccleans up everything β system returns to default routing - Crash recovery β kernel state persists; on restart, existing rules are adopted without disruption
Go 1.23+ and:
BurntSushi/tomlβ config parsingfsnotify/fsnotifyβ config hot-reloadgoogle/nftablesβ nftables managementvishvananda/netlinkβ route/rule managementgolang.org/x/sysβ netlink proc connector