A Bash script to generate WireGuard client and server configuration files, along with keys and QR codes for easy setup.
- Generates client and server configuration files.
- Creates private and public keys.
- Optionally generates and displays a QR code for the client configuration.
- Adds peer configuration to an existing server configuration file.
- Loads settings from a
.env
file.
- Bash
- WireGuard tools (
wg
,wg-quick
) qrencode
(for generating QR codes)
-
Clone the repository:
git clone https://github.com/yourusername/wireguard-config-generator.git cd wireguard-config-generator
-
Install the required tools:
-
Create a
.env
file with your configuration: -
Make the script executable:
chmod +x generate_wireguard_config.sh
Run the script and follow the prompts to generate the configuration files:
./generate_wireguard_config.sh
The script will create keys in the keys
directory, configuration files in the conf
directory, and a QR code image in the conf
directory (if selected).
This project is licensed under the MIT License.