Giter VIP home page Giter VIP logo

etherguard-vpn's Introduction

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 Floyd–Warshall 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 first,get connection info of other EdgeNode from the SuperNode
The SuperNode runs Floyd-Warshall Algorithm,and 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

etherguard-vpn's People

Contributors

apenwarr avatar arg0d avatar baobrien avatar bradfitz avatar cbranch avatar crawshaw avatar danderson avatar eaon avatar filosottile avatar hb9fxq avatar jdtx avatar josharian avatar kayrus avatar kusakabeshi avatar lekensteyn avatar longtianmu avatar lss233 avatar mdlayher avatar mvd-ows avatar riobard avatar rot256 avatar rozmansi avatar siadat avatar thesuess avatar tklauser avatar trishika avatar zx2c4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.