wireguard create new clients automatically Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
naddel81
Posts: 103
Joined: Sun Jul 21, 2019 12:54 pm

wireguard create new clients automatically

Post by naddel81 »

hi @ all,

is it possible to run the basic install script again to copy contents from existing wg0-client.conf with a new key pair to wg1-client.conf, wg2-client.conf etc. to create more clients automatically?

best wishes!
User avatar
Joulinar
Posts: 5693
Joined: Sat Nov 16, 2019 12:49 am

Re: wireguard create new clients automatically

Post by Joulinar »

Hi,

pls have a look to our online docs https://dietpi.com/docs/software/vpn/#wireguard

there is a section on how to add new clients https://dietpi.com/docs/software/vpn/#a ... le-clients
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
naddel81
Posts: 103
Joined: Sun Jul 21, 2019 12:54 pm

Re: wireguard create new clients automatically

Post by naddel81 »

it works like a charm, but maybe it would be possible to input a script that lets the user set a value for clients and those are automatically created. that would be handy.
naddel81
Posts: 103
Joined: Sun Jul 21, 2019 12:54 pm

Re: wireguard create new clients automatically

Post by naddel81 »

UPDATE: when following the script I can create a new client, but when I connect to the server no data is received. in other words: tunnel1 works fine, tunnel 2 won't although the settings are basically the same (except for key pair for client 2).
tried to check every single step. but with no success. do you have an idea?
User avatar
trendy
Posts: 362
Joined: Tue Feb 25, 2020 2:54 pm

Re: wireguard create new clients automatically

Post by trendy »

The IP of the second client should also be different.
User avatar
Joulinar
Posts: 5693
Joined: Sat Nov 16, 2019 12:49 am

Re: wireguard create new clients automatically

Post by Joulinar »

yup, you need to use different IP's for each client

10.9.0.1 Server
10.9.0.2 client 01
10.9.0.3 client 02
10.9.0.4 client 03
aso
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
naddel81
Posts: 103
Joined: Sun Jul 21, 2019 12:54 pm

Re: wireguard create new clients automatically

Post by naddel81 »

I do. How can I start Clean? Deleted WG and install again?

A small Script would be ideal to automate the generation of clients here. Since it is basically the start install Script with modifications I thought it would be handy for many users, too.
User avatar
Joulinar
Posts: 5693
Joined: Sat Nov 16, 2019 12:49 am

Re: wireguard create new clients automatically

Post by Joulinar »

If you have it installed via DietPi software, just uninstall it. If you like something like a script to manage your accounts, you could use PiVPN as command line tool to manage your peers.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3266
Joined: Sat Nov 18, 2017 6:21 pm

Re: wireguard create new clients automatically

Post by MichaIng »

But I agree, a simple dialog/UI for client config creation and revocation would be awesome. We're open for contributions :).
naddel81
Posts: 103
Joined: Sun Jul 21, 2019 12:54 pm

Re: wireguard create new clients automatically

Post by naddel81 »

with pivpn I can manage my wireguard accounts?!? do I have to install wireguard before or is PiVPN --> WG the way to go?
Post Reply