perara / wg-manager

A easy to use WireGuard dashboard and management tool
MIT License
594 stars 74 forks source link

[Enhancement] Custom AllowedIPs for clients on the server side #82

Open Miroka96 opened 3 years ago

Miroka96 commented 3 years ago

Hi!

I would love to be able to set the allowed IPs for a client on the server side to be able to use this configuration for routing purposes. More exactly, I have two wireguard servers with different IP ranges, but I want to have one 'primary' IP range and one secondary, where the secondary is only used to route primary IP addresses directly.

Imagine the following Setup:

Server 1: wg0: 10.0.0.1/24 --> clients connect to this server wg1: 10.0.1.1/24

Server 2: wg0: 10.0.0.2/24 wg1: 10.0.1.2/24 --> clients connect to this server

Client: wg0: 10.0.0.3/24 wg1: 10.0.1.3/24

For wg0 the client connects to server 1 For wg1 the client connects to server 2

Now the client should be able to reach Server 2 on 10.0.0.2 (wg0) without going over Server 1 (10.0.0.1 - wg0 host). This requires the following allowed IPs:

wg1 on the client: 10.0.1.0/24, 10.0.0.2/32 wg1 on Server 2 in the client section: 10.0.1.3/32, 10.0.0.3/32

Trust me, this setup works. I just want to be able to configure this using the web UI without downloading and modifying the created configuration file.

Cheers! Miroka

Miroka96 commented 3 years ago

Furthermore, it would be cool to enable configuring Post-Up and Post-Down scripts for clients. Thanks in advance!

Maybe I find some time to join in for development