Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 53 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,77 @@

# minivtun-win

[中文使用帮助](https://github.com/boytm/minivtun-win/wiki)

The minivtun is a tiny layer 3 vpn service on posix platform.
And this is a windows client for it.
A lightweight Layer 3 VPN client for Windows, compatible with the [minivtun](https://github.com/izhaohui/minivtun) protocol.

No IPv6 tunnel and point-to-point mode due to limitation of tap-windows driver
## Features

# Installation #
- Support for both **TAP-Windows** (OpenVPN) and **Wintun** (WireGuard) network interfaces.
- Lightweight and efficient tunneling in non-standard protocols.
- Multiple encryption types supported: AES-128, AES-256, RC4, DES, and DESX.
- IPv4 tunneling (IPv6 and Point-to-Point modes are currently not supported due to driver limitations).

### Install windows tap driver
## Prerequisites

site:
https://github.com/OpenVPN/tap-windows https://github.com/OpenVPN/tap-windows6
- **Python 3.x**
- Windows 7 or later.
- One of the following network drivers:
- **TAP-Windows**: [Download from OpenVPN](https://github.com/OpenVPN/tap-windows6)
- **Wintun**: [Download wintun.dll from wintun.net](https://www.wintun.net/) (place `wintun.dll` in the same directory as `tun.py`).

precompiled binary:
* NIDS 5 (windows xp and above) https://swupdate.openvpn.org/community/releases/tap-windows-9.9.2_3.exe
* NIDS 6 (windows vista and above) https://swupdate.openvpn.org/community/releases/tap-windows-9.21.1.exe
## Installation


### Install required development components
python 2.7
python package: ipaddress pywin32 wmi M2Crypto
1. Install the required network driver (TAP or Wintun).
2. Install the necessary Python dependencies:

```cmd
python -m pip install -r requirements.txt
pip install -r requirements.txt
```

### Compile and pack
python setup.py py2exe

# Usage #
## Usage

Mini virtual tunneller in non-standard protocol.
Usage:
minivtun [options]
Options:
-r, --remote <ip:port> IP:port of server to connect
-a, --ipv4-addr <tun_lip/pfx_len> IPv4 address/prefix length pair
-k, --keepalive <keepalive_timeo> seconds between sending keep-alive packets, default: 13
-t, --type <encryption_type> encryption type, default: aes_128_cbc
-e, --key <encrypt_key> shared password for data encryption (if this option is missing, turn off encryption)
-d run as daemon process
-h, --help print this help
Supported encryption types:
rc4, des, desx, aes-256, aes-128
Run the client with administrator privileges.

```text
usage: tun.py [-r REMOTE] [-a IPV4_ADDR] [-k KEEPALIVE] [-t {aes-128,aes-256,rc4,des,desx}] [-e KEY] [-n] [-d] [--verbose]

### Examples
Mini virtual tunneller in non-standard protocol.

Require administrator permission
optional arguments:
-r REMOTE, --remote REMOTE
IP:port of server to connect
-a IPV4_ADDR, --ipv4-addr IPV4_ADDR
IPv4 address/prefix length pair (e.g. 10.7.0.33/24)
-k KEEPALIVE, --keepalive KEEPALIVE
seconds between sending keep-alive packets
-t {aes-128,aes-256,rc4,des,desx}, --type {aes-128,aes-256,rc4,des,desx}
encryption type (default: aes-128)
-e KEY, --key KEY shared password for data encryption
-n, --wintun use wintun driver
-d run as daemon process (background mode)
--verbose enable verbose logging
```

Client: Connect VPN to the server (assuming address vpn.abc.com), with local virtual address 10.7.0.33, encryption with password "Hello":
### Examples

python tun.py -r vpn.abc.com:1414 -a 10.7.0.33/24 -e Hello
**Using TAP driver:**
Connect to `vpn.example.com:1414` with virtual IP `10.7.0.33` and password `MySecret`:
```cmd
python tun.py -r vpn.example.com:1414 -a 10.7.0.33/24 -e MySecret
```

Client: Connect VPN to the server (assuming address vpn.abc.com), with local virtual address 10.7.0.33, no encryption:
**Using Wintun driver:**
Ensure `wintun.dll` is in the same folder:
```cmd
python tun.py -r vpn.example.com:1414 -a 10.7.0.33/24 -e MySecret --wintun
```

python tun.py -r vpn.abc.com:1414 -a 10.7.0.33/24
## Compilation

You can pack the script into a Windows executable using `py2exe`:

### TODO
```cmd
python setup.py py2exe
```

route control
## License

This project is licensed under the Apache License, Version 2.0.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ipaddress
pywin32
wmi
M2Crypto
pycryptodome
dpkt
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from distutils.core import setup
from setuptools import setup
import py2exe

setup(
Expand All @@ -9,5 +9,11 @@
}
},
console=['tun.py'],
zipfile = None
zipfile = None,
install_requires=[
'pywin32',
'wmi',
'pycryptodome',
'dpkt'
]
)
Loading