A simple shell script to generate Wireguard configs only
Generate working server and client configuration files. The server config only works on Linux but client configs should work on any OS.
The script requires prior knowledge of the server's network interface and IP address and/or domain name to work.
Note: each time the script is run, all previously generated configs under wgconfigs
will be removed.
Set up a Wireguard server from scratch. For that purpose please check out other people's excellent work. Some examples are:
- https://github.com/angristan/wireguard-install
- https://github.com/alvistack/ansible-role-wireguard
- https://github.com/burghardt/easy-wg-quick
- Randomly generated IPv4 and IPv6 addresses
- Randomly generated port number
- Randomly generated pre-shared key, unique to each client
- Relatively new
bash
shuf
wireguard-tools
- modify the variables at the beginning of the script accordingly
- run the script
- Copy the generated server config (
wgconfigs/${WG_INTERFACE}.conf
) to the server and bring it up withwg-quick
- Copy the generated client configs (
wgconfigs/clientconfigs/*.conf
) to the clients