All Projects → mudler → edgevpn

mudler / edgevpn

Licence: Apache-2.0 license
⛵ The immutable, decentralized, statically built p2p VPN without any central server and automatic discovery! Create decentralized introspectable tunnels over p2p with shared tokens

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to edgevpn

ipvpn
[WIP] Easy-to-use decentralized secure overlay private network (for any device)
Stars: ✭ 24 (-89.24%)
Mutual labels:  ipfs, nat, vpn, mesh
Fq Book
📖《这本书能让你连接互联网》详细阐述代理、隧道、VPN运作过程,并对GFW策略如:地址端口封锁、服务器缓存投毒、数字验证攻击、SSL连接阻断做相关的原理说明
Stars: ✭ 2,393 (+973.09%)
Mutual labels:  tunnel, ipfs, vpn
netmaker
Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
Stars: ✭ 4,147 (+1759.64%)
Mutual labels:  mesh-networks, vpn, mesh
Inlets Pro
Secure TCP and HTTP tunnels that work anywhere
Stars: ✭ 179 (-19.73%)
Mutual labels:  tunnel, nat, mesh
tunman
Comprehensive solution for SSH tunnels - respawning, healthchecking/monitoring
Stars: ✭ 43 (-80.72%)
Mutual labels:  tunnel, nat, vpn
Wireguard Private Networking
Build your own multi server private network using wireguard and ansible
Stars: ✭ 124 (-44.39%)
Mutual labels:  mesh-networks, vpn, mesh
Prototype Cjdns Pi
Prototype system for mesh networks on single board computers
Stars: ✭ 205 (-8.07%)
Mutual labels:  mesh-networks, ipfs, mesh
Wireguard Docs
📖 Unofficial WireGuard Documentation: Setup, Usage, Configuration, and full example setups for VPNs supporting both servers & roaming clients.
Stars: ✭ 3,201 (+1335.43%)
Mutual labels:  tunnel, nat, vpn
Sidedoor
SSH connection daemon for Debian/Raspbian/Ubuntu/etc
Stars: ✭ 97 (-56.5%)
Mutual labels:  tunnel, nat
Frp
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Stars: ✭ 51,746 (+23104.48%)
Mutual labels:  tunnel, nat
Server Go
🎨OpenIoTHub Server[内网穿透和物联网设备管理服务器]
Stars: ✭ 127 (-43.05%)
Mutual labels:  tunnel, nat
Tcptunnel
将本地内网服务器映射到公网。
Stars: ✭ 72 (-67.71%)
Mutual labels:  tunnel, nat
Simple Vpn Demo
A Simple Point-to-Point tunnelling implementation in C
Stars: ✭ 59 (-73.54%)
Mutual labels:  tunnel, vpn
Gateway Go
🎁GateWay Client for OpenIoTHub[云易连访问内网端口和设备的网关]
Stars: ✭ 127 (-43.05%)
Mutual labels:  tunnel, nat
Mr2
Mr.2 can help you expose local server to external network. Support both TCP/UDP, of course support HTTP. Zero-Configuration.
Stars: ✭ 1,102 (+394.17%)
Mutual labels:  tunnel, nat
V2ray Core
A platform for building proxies to bypass network restrictions.
Stars: ✭ 13,438 (+5926.01%)
Mutual labels:  tunnel, vpn
Tunnelkit
Non-official OpenVPN client library for Apple platforms.
Stars: ✭ 180 (-19.28%)
Mutual labels:  tunnel, vpn
Awesome Anti Gfw
突破网络审查和封锁的开源工具清单。
Stars: ✭ 198 (-11.21%)
Mutual labels:  tunnel, vpn
Fasttunnel
NAT 内网穿透 远程内网计算机 域名访问内网站点 反向代理内网服务 花生壳 端口转发 http代理 微信 小程序 expose a local server behind a NAT or firewall to the internet like ngrok and frp. NAT ssh proxy tunnel reverse-proxy
Stars: ✭ 248 (+11.21%)
Mutual labels:  tunnel, nat
Frpc Android
Android,安卓版frpc,一个快速反向代理,可帮助您将NAT或防火墙后面的本地服务器暴露给Internet。
Stars: ✭ 205 (-8.07%)
Mutual labels:  tunnel, nat


logo
EdgeVPN

Create Decentralized private networks

license go report card


Fully Decentralized. Immutable. Portable. Easy to use Statically compiled VPN and a reverse proxy over p2p.
VPN - Reverse Proxy - Send files securely over p2p - Blockchain

EdgeVPN uses libp2p to build private decentralized networks that can be accessed via shared secrets.

It can:

  • Create a VPN : Secure VPN between p2p peers

    • Automatically assign IPs to nodes
    • Embedded tiny DNS server to resolve internal/external IPs
    • Create trusted zones to prevent network access if token is leaked
  • Act as a reverse Proxy : Share a tcp service like you would do with ngrok. EdgeVPN let expose TCP services to the p2p network nodes without establishing a VPN connection: creates reverse proxy and tunnels traffic into the p2p network.

  • Send files via p2p : Send files over p2p between nodes without establishing a VPN connection.

  • Be used as a library: Plug a distributed p2p ledger easily in your golang code!

See the documentation.

📷 Screenshots

Dashboard (Dark mode) Dashboard (Light mode)
Screenshot 2021-10-31 at 00-12-16 EdgeVPN - Machines index Screenshot 2021-10-31 at 23-03-26 EdgeVPN - Machines index
DNS Machine index
Screenshot 2021-10-31 at 23-03-44 EdgeVPN - Services index Screenshot 2021-10-31 at 23-03-59 EdgeVPN - Files index
Services Blockchain index
Screenshot 2021-10-31 at 23-04-12 EdgeVPN - Users connected Screenshot 2021-10-31 at 23-04-20 EdgeVPN - Blockchain index

🆕 GUI

A Desktop GUI application (alpha) for Linux is available here

Dashboard Connections index
edgevpn-gui-2 edgevpn-3
edgevpn-gui

Kubernetes

Check out c3os for seeing EdgeVPN in action with Kubernetes!

🏃 Installation

Download the precompiled static release in the releases page. You can either install it in your system or just run it.

💻 Usage

EdgeVPN works by generating tokens (or a configuration file) that can be shared between different machines, hosts or peers to access to a decentralized secured network between them.

Every token is unique and identifies the network, no central server setup, or specifying hosts ip is required.

To generate a config run:

# Generate a new config file and use it later as EDGEVPNCONFIG
$ edgevpn -g > config.yaml

OR to generate a portable token:

$ EDGEVPNTOKEN=$(edgevpn -g -b)

Note, tokens are config merely encoded in base64, so this is equivalent:

$ EDGEVPNTOKEN=$(edgevpn -g | tee config.yaml | base64 -w0)

All edgevpn commands emplies that you either specify a EDGEVPNTOKEN (or --token as parameter) or a EDGEVPNCONFIG as this is the way for edgevpn to establish a network between the nodes.

The configuration file is the network definition and allows you to connect over to your peers securely.

Warning Exposing this file or passing-it by is equivalent to give full control to the network.

📡 As a VPN

To start the VPN, simply run edgevpn without any argument.

An example of running edgevpn on multiple hosts:

# on Node A
$ EDGEVPNTOKEN=.. edgevpn --address 10.1.0.11/24
# on Node B
$ EDGEVPNTOKEN=.. edgevpn --address 10.1.0.12/24
# on Node C ...
$ EDGEVPNTOKEN=.. edgevpn --address 10.1.0.13/24
...

... and that's it! the --address is a virtual unique IP for each node, and it is actually the ip where the node will be reachable to from the vpn. You can assign IPs freely to the nodes of the network, while you can override the default edgevpn0 interface with IFACE (or --interface)

Note: It might take up time to build the connection between nodes. Wait at least 5 mins, it depends on the network behind the hosts.

Is it for me?

EdgeVPN makes VPN decentralization a first strong requirement.

Its mainly use is for edge and low-end devices and especially for development.

The decentralized approach has few cons:

  • The underlaying network is chatty. It uses a Gossip protocol for syncronizing the routing table and p2p. Every blockchain message is broadcasted to all peers, while the traffic is to the host only.
  • Might be not suited for low latency workload.

Keep that in mind before using it for your prod networks!

But it has a strong pro: it just works everywhere libp2p works!

Why?

First of all it's my first experiment with libp2p. Second, I always wanted a more "open" ngrok alternative, but I always prefer to have "less infra" as possible to maintain. That's why building something like this on top of libp2p makes sense.

⚠️ Warning!

I'm not a security expert, and this software didn't went through a full security audit, so don't use and rely it for sensible traffic and not even for production environment! I did this mostly for fun while I was experimenting with libp2p.

Example use case: network-decentralized k3s test cluster

Let's see a practical example, you are developing something for kubernetes and you want to try a multi-node setup, but you have machines available that are only behind NAT (pity!) and you would really like to leverage HW.

If you are not really interested in network performance (again, that's for development purposes only!) then you could use edgevpn + k3s in this way:

  1. Generate edgevpn config: edgevpn -g > vpn.yaml

  2. Start the vpn:

    on node A: sudo IFACE=edgevpn0 ADDRESS=10.1.0.3/24 EDGEVPNCONFIG=vpn.yml edgevpn

    on node B: sudo IFACE=edgevpn0 ADDRESS=10.1.0.4/24 EDGEVPNCONFIG=vpm.yml edgevpn

  3. Start k3s:

    on node A: k3s server --flannel-iface=edgevpn0

    on node B: K3S_URL=https://10.1.0.3:6443 K3S_TOKEN=xx k3s agent --flannel-iface=edgevpn0 --node-ip 10.1.0.4

We have used flannel here, but other CNI should work as well.

📓 As a library

EdgeVPN can be used as a library. It is very portable and offers a functional interface.

To join a node in a network from a token, without starting the vpn:

import (
    node "github.com/mudler/edgevpn/pkg/node"
)

e := node.New(
    node.Logger(l),
    node.LogLevel(log.LevelInfo),
    node.MaxMessageSize(2 << 20),
    node.FromBase64( mDNSEnabled, DHTEnabled, token ),
    // ....
  )

e.Start(ctx)

or to start a VPN:

import (
    vpn "github.com/mudler/edgevpn/pkg/vpn"
    node "github.com/mudler/edgevpn/pkg/node"
)

opts, err := vpn.Register(vpnOpts...)
if err != nil {
	return err
}

e := edgevpn.New(append(o, opts...)...)

e.Start(ctx)

🧑‍💻 Projects using EdgeVPN

  • Kairos - creates Kubernetes clusters with K3s automatically using EdgeVPN networks

🐜 Contribution

You can improve this project by contributing in following ways:

  • report bugs
  • fix issues
  • request features
  • asking questions (just open an issue)

and any other way if not mentioned here.

📓 Credits

📓 Troubleshooting

If during bootstrap you see messages like:

edgevpn[3679]:             * [/ip4/104.131.131.82/tcp/4001] failed to negotiate stream multiplexer: context deadline exceeded     

or

edgevpn[9971]: 2021/12/16 20:56:34 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.

or generally experiencing poor network performance, it is recommended to increase the maximum buffer size by running:

sysctl -w net.core.rmem_max=2500000

📓 TODO

  • VPN
  • Send and receive files via p2p
  • Expose remote/local services via p2p tunnelling
  • Store arbitrary data on the blockchain
  • Allow to persist blockchain on disk

📓 LICENSE

Apache License v2.

edgevpn  Copyright (C) 2021 Ettore Di Giacinto
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].