Layer2 version of wireguard with Floyd Warshall implement in go.
Go to file
2022-02-27 00:44:27 +08:00
.github/workflows version.go autoupdate 2021-12-27 14:03:06 +00:00
.vscode update go-cache to fix p2p mode concurrency map access 2022-01-25 22:32:48 +00:00
conn Add DisabledAf 2022-01-09 00:26:20 +00:00
device fix supernode resetconn not work 2022-01-24 14:02:41 +00:00
example_config update readme 2022-02-10 16:01:39 +00:00
gencfg allow gencfg overwrite and ntp all failed 2022-02-10 15:31:11 +00:00
ipc http based pong_msg 2021-12-03 20:16:18 +00:00
mtypes Add DisabledAf 2022-01-09 00:26:20 +00:00
orderdmap bugfix: addpeer API. new: tcpsock,udpsock,fd 2021-10-06 08:47:57 +00:00
path allow gencfg overwrite and ntp all failed 2022-02-10 15:31:11 +00:00
ratelimiter global: bump copyright 2021-01-28 17:52:15 +01:00
replay global: bump copyright 2021-01-28 17:52:15 +01:00
rwcancel rwcancel: use ordinary os.ErrClosed instead of custom error 2021-05-20 17:56:36 +02:00
tai64n tai64n: add string representation for error messages 2021-02-03 17:56:46 +01:00
tap Allow exact IP, update error msg, fix getIFIndex 2022-01-03 22:02:40 +00:00
.gitignore Update publish.yml 2021-12-27 10:06:15 +00:00
code_of_conduct.md Static mode for supernode,dump packet, update readme, add code of concept 2021-09-30 21:44:07 +00:00
go.mod update go-cache to fix p2p mode concurrency map access 2022-01-25 22:32:48 +00:00
go.sum update go-cache to fix p2p mode concurrency map access 2022-01-25 22:32:48 +00:00
govpp_remove_crcstring_check.patch workaround for bug https://jira.fd.io/projects/GOVPP/issues/GOVPP-22 2021-08-25 18:20:17 +00:00
LICENSE mod: rename COPYING to LICENSE 2021-03-06 09:09:21 -07:00
main_edge.go Add DisabledAf 2022-01-09 00:26:20 +00:00
main_httpserver.go Add DisabledAf 2022-01-09 00:26:20 +00:00
main_super.go fix supernode resetconn not work 2022-01-24 14:02:41 +00:00
main.go pprof 2022-01-21 06:42:27 +00:00
Makefile version.go autoupdate 2021-12-27 14:03:06 +00:00
README_zh.md Update README_zh.md 2022-02-27 00:44:27 +08:00
README.md Update readme.md 2021-12-24 17:07:52 +00:00
version.go update readme 2022-02-10 16:01:39 +00:00

Etherguard

English | 中文

Contributor Covenant

A Full Mesh Layer2 VPN based on wireguard-go

OSPF can find best route based on it's cost.
But sometimes the latency are different in the packet goes and back.
I'm thinking, is it possible to find the best route based on the single-way latency?

For example, I have two routes A and B at node N1, both of them can reach my node N2. A goes fast, but B backs fast.
My VPN can automatically send packet through route A at node N1, and the packet backs from route B.

Here is the solution. This VPN Etherguard can collect all the single-way latency from all nodes, and calculate the best route using FloydWarshall algorithm.

Worried about the clock not match so that the measure result are not correct? It doesn't matter, here is the proof (Mandarin): https://www.kskb.eu.org/2021/08/rootless-routerpart-3-etherguard.html

Usage

Usage of ./etherguard-go:
  -bind string
        UDP socket bind mode. [linux|std]
        You may need std mode if you want to run Etherguard under WSL. (default "linux")
  -cfgmode string
        Running mode for generated config. [none|super|p2p]
  -config string
        Config path for the interface.
  -example
        Print example config
  -help
        Show this help
  -mode string
        Running mode. [super|edge|solve|gencfg]
  -no-uapi
        Disable UAPI
        With UAPI, you can check etherguard status by "wg" command
  -version
        Show version

Working Mode

Mode Description
Static Mode No dynamic routing, no handshake server.
Similar to original wireguard , all configs are static
Detail
Super Mode Inspired by n2n. There 2 types of node: SuperNode and EdgeNode
EdgeNode must connect to SuperNode firstget connection info of other EdgeNode from the SuperNode
The SuperNode runs Floyd-Warshall Algorithmand distribute the result to all other EdgeNodes.
Detail
P2P Mode Inspired by tinc, There are no SuperNode. All EdgeNode will exchange information each other.
EdgeNodes are keep trying to connect each other, and notify all other peers success or not.
All edges runs Floyd-Warshall Algorithm locally and find the best route by it self.
Not recommend to use this mode in production environment, not test yet.
Detail

Quick start

Super mode quick start

Build

No-vpp version

Build Etherguard.

Install Go 1.16

add-apt-repository ppa:longsleep/golang-backports
apt-get -y update
apt-get install -y wireguard-tools golang-go build-essential git

Build

make

VPP version

Build Etherguard with VPP integrated.
You need libmemif.so installed to run this version.

Install VPP and libmemif

echo "deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main" > /etc/apt/sources.list.d/99fd.io.list
curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -
apt-get -y update
apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev

Build

make vpp