All Projects → net-byte → vtun

net-byte / vtun

Licence: MIT license
A simple VPN written in Go.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to vtun

opengnb
GNB is open source de-centralized VPN to achieve layer3 network via p2p with the ultimate capability of NAT Traversal.GNB是一个开源的去中心化的具有极致内网穿透能力的通过P2P进行三层网络交换的VPN。
Stars: ✭ 440 (-25.68%)
Mutual labels:  tun, udp, vpn
Libzt
ZeroTier Sockets - Put a network stack in your app
Stars: ✭ 486 (-17.91%)
Mutual labels:  udp, vpn
iit-kgp-network
Information repository and Solutions on IIT KGP Internet Problems.
Stars: ✭ 28 (-95.27%)
Mutual labels:  udp, vpn
Leaf
A lightweight and fast proxy utility tries to include any useful features.
Stars: ✭ 530 (-10.47%)
Mutual labels:  udp, vpn
Simple Vpn Demo
A Simple Point-to-Point tunnelling implementation in C
Stars: ✭ 59 (-90.03%)
Mutual labels:  udp, vpn
Wireguard Docs
📖 Unofficial WireGuard Documentation: Setup, Usage, Configuration, and full example setups for VPNs supporting both servers & roaming clients.
Stars: ✭ 3,201 (+440.71%)
Mutual labels:  udp, vpn
Gnb
GNB is open source de-centralized VPN to achieve layer3 network via p2p with the ultimate capability of NAT Traversal.GNB是一个开源的去中心化的具有极致内网穿透能力的通过P2P进行三层网络交换的VPN。
Stars: ✭ 225 (-61.99%)
Mutual labels:  udp, vpn
net-protocol
golang模拟内核协议栈 实现链路层、网络层、传输层、应用层 用户态协议栈 ,基于虚拟网卡TUN/TAP
Stars: ✭ 129 (-78.21%)
Mutual labels:  tun, udp
sx
🖖 Fast, modern, easy-to-use network scanner
Stars: ✭ 1,267 (+114.02%)
Mutual labels:  udp
wireguard-kmod
WireGuard for UDM series routers
Stars: ✭ 328 (-44.59%)
Mutual labels:  vpn
AMP-Research
Research on UDP/TCP amplification vectors, payloads and mitigations against their use in DDoS Attacks
Stars: ✭ 246 (-58.45%)
Mutual labels:  udp
netstack
A batteries included networking crate for games.
Stars: ✭ 40 (-93.24%)
Mutual labels:  udp
BindToInterface
With this program you can bind applications to a specific network interface / network adapter. This is very useful if you have multiple (internet) connections and want your program to use a specific one.
Stars: ✭ 67 (-88.68%)
Mutual labels:  vpn
HelenaFramework
Modern framework on C++20 for backend/frontend development.
Stars: ✭ 53 (-91.05%)
Mutual labels:  udp
ZudVPN
A mobile application to deploy private VPN servers in the cloud with DNS ad-blocking and other features
Stars: ✭ 119 (-79.9%)
Mutual labels:  vpn
NordVPN-switcher
Rotate between different NordVPN servers with ease. Works both on Linux and Windows without any required changes to your code!
Stars: ✭ 143 (-75.84%)
Mutual labels:  vpn
SpooferBT
Relay torrent tracker communication via TCP to bypass a blocked UDP network.
Stars: ✭ 18 (-96.96%)
Mutual labels:  udp
fubuki
Simple VPN implemented using rust
Stars: ✭ 85 (-85.64%)
Mutual labels:  vpn
ucsf-vpn
Linux command-line client to manage a UCSF VPN connection
Stars: ✭ 30 (-94.93%)
Mutual labels:  vpn
Socket-Programming-With-C
✉️ Learn Network Protocol and Network Programming
Stars: ✭ 147 (-75.17%)
Mutual labels:  udp

vtun

A simple VPN written in Go.

EN | 中文

Travis Go Report Card image image image

Features

  • VPN over udp
  • VPN over websocket
  • VPN over tls
  • VPN over grpc
  • VPN over quic
  • VPN over kcp

Usage

Usage of ./vtun:
  -S    server mode
  -c string
        tun interface cidr (default "172.16.0.10/24")
  -c6 string
        tun interface ipv6 cidr (default "fced:9999::9999/64")
  -certificate string
        tls certificate file path (default "./certs/server.pem")
  -privatekey string
        tls certificate key file path (default "./certs/server.key")
  -sni string
        tls handshake sni
  -isv
        tls insecure skip verify
  -dn string
        device name
  -g    client global mode
  -k string
        key (default "freedom@2022")
  -l string
        local address (default ":3000")
  -mtu int
        tun mtu (default 1500)
  -obfs
        enable data obfuscation
  -compress
        enable data compression
  -p string
        protocol udp/tls/grpc/quic/kcp/ws/wss (default "udp")
  -path string
        websocket path (default "/freedom")
  -s string
        server address (default ":3001")
  -sip string
        server ip (default "172.16.0.1")
  -sip6 string
        server ipv6 (default "fced:9999::1")
  -dip string
        dns server ip (default "8.8.8.8")
  -t int
        dial timeout in seconds (default 30)
  -v    enable verbose output

Build

scripts/build.sh

Client on Linux

sudo ./vtun-linux-amd64 -s server-addr:3001 -c 172.16.0.10/24 -k 123456

Client on Linux with global mode(routing all your traffic to server)

sudo ./vtun-linux-amd64 -s server-addr:3001 -c 172.16.0.10/24 -k 123456 -g

Client on MacOS

sudo ./vtun-darwin-amd64 -s server-addr:3001 -c 172.16.0.10/24 -k 123456 -g -sip 172.16.0.1

Client on Windows

To use it with windows, you will need to download a wintun.dll file in the app directory.
Open powershell as administrator and run cmd:

.\vtun-win-amd64.exe  -s server-addr:3001 -c 172.16.0.10/24 -k 123456 -g -sip 172.16.0.1

Server on Linux

sudo ./vtun-linux-amd64 -S -l :3001 -c 172.16.0.1/24 -k 123456

Iptables setup on Linux server

  # Enable ipv4 and ipv6 forward
  vi /etc/sysctl.conf
  net.ipv4.ip_forward = 1
  net.ipv6.conf.all.forwarding=1
  sysctl -p /etc/sysctl.conf
  # Masquerade outgoing traffic
  iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
  # Allow return traffic
  iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
  iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
  # Forward everything
  iptables -A FORWARD -j ACCEPT

Docker

docker image

Run client

docker run  -d --privileged --restart=always --net=host --name vtun-client \
netbyte/vtun -s server-addr:3001 -c 172.16.0.10/24 -k 123456

Run client with global mode

docker run  -d --privileged --restart=always --net=host --name vtun-client \
netbyte/vtun -s server-addr:3001 -c 172.16.0.10/24 -k 123456 -g

Run server

docker run  -d --privileged --restart=always --net=host --name vtun-server \
netbyte/vtun -S -l :3001 -c 172.16.0.1/24 -k 123456

Mobile client

Android

License

The MIT License (MIT)

Acknowledgments

Thanks JetBrains for providing licenses.

JetBrains Logo (Main) logo.

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].