k4yt3x / wg-meshconf

WireGuard full mesh configuration generator.
GNU General Public License v3.0
955 stars 105 forks source link

Add PostUP and AllowedIPs #5

Closed adeepv closed 4 years ago

adeepv commented 5 years ago

I add PostUP config line and allow AllowedIP cointain more ip/networks than one.

adeepv commented 5 years ago

For first time I need PostUp and AllowedIPs. But add all features is a good idea :)

k4yt3x commented 5 years ago

I have just updated the repo on https://github.com/k4yt3x/wireguard-mesh-configurator/tree/1.3.0. Take a look and see what you think of it?

adeepv commented 5 years ago

Good work. But you missed the option, when server provides access to other subnets, for example:

[Peer]
# Alias: gw0
# Description: PoP gw0
PublicKey = AA4TplLZMjxTuYGM6iG2+MzKOST+KI70E8K0J/fhDkU=
AllowedIPs = 10.100.100.2/24,192.168.243.0/24
Endpoint = 176.x.x.x:51820
PersistentKeepalive = 25

AllowedIPs can contain comma separated CIDR, where first CIDR we can use as Peer local IP address. Once we consider the input data valid a priori.

k4yt3x commented 5 years ago

With the current structure, if we want AllowIPs, then all we need to do is adding this line:

image

Should I add some validation for the input?

adeepv commented 5 years ago

I think additional validation is currently meaningless. You can add default values, for example port number (51820 or copy last entered value), CIDR /32 for ipv4 in Address

adeepv commented 5 years ago

It looks like AllowedIPs should have a client address in its list, so I propose change peer_config['AllowedIPs'] = Avalon.gets('AllowedIPs (optional): ') to peer_config['AllowedIPs'] = peer_config['Address']+', '+Avalon.gets('AllowedIPs (optional): ') with additional check for empy values

adeepv commented 5 years ago

And error :) Wrong generation of config. You need Endpoint in configuration file in this syntaxis: Endpoint = <public ip>:<port>

adeepv commented 5 years ago

Persistent keepalive interval is neither 0/off nor 1-65535: `True'

k4yt3x commented 4 years ago

I just published 2.0.0, which should be way more modular. Check to see if it fits your taste