Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AllowedIPs optional setting for peers #92

Open
jine opened this issue Oct 27, 2021 · 4 comments
Open

Add AllowedIPs optional setting for peers #92

jine opened this issue Oct 27, 2021 · 4 comments
Labels
enhancement New feature or request not initially planned

Comments

@jine
Copy link

jine commented Oct 27, 2021

Is your feature request related to a problem? Please describe.
I would like to add an optional field when adding peers - AllowedIPs configuration

Describe the solution you'd like
Would also be great if it was based upon templates/pre-existing/pre-used (autocomplete maybe??) values.

Describe alternatives you've considered
Currently I'm manually edit each peer-config, which unfortunately makes the pre-existing QR-code generator unusable.

Additional context
I'm not that great of a python developer, but i'll make an effort in modifying this myself later this week...

@jine jine added the enhancement New feature or request not initially planned label Oct 27, 2021
@jine
Copy link
Author

jine commented Oct 27, 2021

Note that i'm adding both subnets and a list of IPs (/32s), having them in a "template" or / and auto-completed from previous peers would be best i think.

@jine
Copy link
Author

jine commented Oct 28, 2021

Tunnel all traffic for the public internet over WG (exclude any/all local network subnets)

EDIT: CORRECTED 2021-11-22:
AllowedIPs = 1.0.0.0/8, 2.0.0.0/7, 4.0.0.0/6, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/3, 96.0.0.0/4, 112.0.0.0/5, 120.0.0.0/6, 124.0.0.0/7, 126.0.0.0/8, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/8, 169.0.0.0/9, 169.128.0.0/10, 169.192.0.0/11, 169.224.0.0/12, 169.240.0.0/13, 169.248.0.0/14, 169.252.0.0/15, 169.255.0.0/16, 170.0.0.0/7, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/4, ::/1, 8000::/2, c000::/3, e000::/4, f000::/5, f800::/6, fe00::/9, fec0::/10, ff00::/8

For instance, as the WG-android app does - is a hell of a config to copy and paste each time, that should definitely be an option aswell while creating peers.

EDIT: CORRECTED 2021-11-22:
I've updated the above string, we had missed a few nets (especially - it had 0.0.0.0/5 in the beginning which is incorrect...)
https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/ is a great guideline.

@joseantmazonsb joseantmazonsb added this to the 1.2.0 milestone Nov 2, 2021
@grishingr
Copy link

grishingr commented Nov 13, 2021

This is an unpleasant feature. This problem is solved by replacing the validators in the ipv4 field:
ipv4 = StringField("IPv4", validators=[DataRequired(), PeerIpValidator()],
render_kw={"placeholder": "0.0.0.0/32"})

In this class:
class PeerIpValidator

@jine
Copy link
Author

jine commented Nov 22, 2021

Huh? The problem? It's not really a problem, more of an enhancement with more features (such as autocompletion of input subnets, common ones/previously used ones for instance).... ?

But yeah - thanks for the input on where the placeholder comes from!

I've also just updated the allowed ips above, we realized those before were actually wrong... :)

@joseantmazonsb joseantmazonsb removed this from the 1.2.0 milestone Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request not initially planned
Projects
None yet
Development

No branches or pull requests

3 participants