WireGuard Micro VPN
Project GitHub Repository
Wireguard library
Compiled Program Description
The WireGuard Micro VPN is a simple command-line application written in Go that allows users to manage WireGuard VPN configurations.
Users can configure server settings, add clients, start/stop VPN connections, and send configuration files to clients via Telegram.
The program operates with both automatic and manual modes for setting up WireGuard server configurations.
Main Features:
- Start WireGuard server in automatic or manual configuration mode.
- Generate and display server private and public keys.
- Add new clients to the VPN with unique keys and addresses.
- Send client configuration files via Telegram using bot integration.
- Start, stop, or delete client connections individually.
- View all configured clients and their connection details.
- Remove the WireGuard configuration and scripts, stopping the VPN server.
Instructions for Running the Compiled Program
- Clone the repository:
git clone https://github.com/R0n1ns/wireguard-micro-vpn
- Install dependencies:
sudo apt install wireguard
- Move to folder:
cd wireguard-micro-vpn
- Change mod for run:
chmod +x micro
- Run the compiled program:
sudo ./micro
- Program Usage: After starting the program, follow the prompts to interact with the WireGuard VPN setup. The available commands include:
- 1: Start WireGuard server (manual or automatic configuration)
- 2: Add a new client
- 3: Stop a client connection
- 4: Activate a client connection
- 5: Delete a client connection
- 6: List all clients
- 7: Send client configuration to Telegram
- -2: Remove WireGuard configuration and stop the server
- -1: Exit the program
Automatic Configuration Mode:
When starting the WireGuard server, you can choose automatic mode by entering 0
when prompted.
In this mode, the server will use default settings such as port 51820 and network interface eth0
.
Manual Configuration Mode:
If you choose manual configuration by entering 1
, you will be prompted to enter the server's port,
network interface name, and server IP. You will also be required to provide a bot token for Telegram integration.
Telegram Integration:
The program uses a Telegram bot to send client configuration files directly to users. You must provide a valid bot token
when prompted during the setup or add client processes.
Error Handling
If an error occurs during the execution of the program, it will automatically attempt to recover and reload the saved configuration from data.json
.
Exiting the Program
To safely exit the program, enter -1
at any time. This will save the current state and terminate the program.