Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The initial implementation of wireguard support failed for > 1 tunnel server because of the way wireguard handles routing. Wireguard requires not only the next hop route to be specified in the "allowed ips" list, but all possibly destinations. The target 0.0.0.0/0 can help here, but you can only use that on 1 peer .. so the moment we need 2 peers this approach fails.
This version solve the problem by creating unique server/client peers and each can be given 0.0.0.0/0. The cost to do this is that each server must have its own port number, so we cannot use just 1 port for wireguard, but instead an array of ports; 5525, 5526, 5526 ...
Supernode wireguard ports now start at 6526 to allow a single IP to front both a normal wireguard tunnel server and a supernode tunnel server.