naggie / dsnet

FAST command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.
https://calbryant.uk/blog/how-to-set-up-a-wireguard-vpn-in-minutes-with-dsnet/
MIT License
679 stars 32 forks source link

Wrong config output #65

Closed Snowb1ind closed 2 years ago

Snowb1ind commented 2 years ago

If you try to use latest master version it creates broken user configs that looks like this :

[Interface]
Address=fd00:c6f2:a99b:d600:b3a1:e77f:2380:14a2/22
Address=<nil>/64
PrivateKey=8KkQ3rxeiP4/rZn9SLYtTelCrmM0DAvoN5bvjp0o6Fs=

[Peer]
PublicKey=knQBLoy6mWFDWL+XukG0MPOwHgGTSZwTFFmsM9MFnCI=
PresharedKey=eOUvrmUWVSy5SxtJ70UzxToRwwV5EuFtS/6HKiKvck4=
Endpoint=<Public IP is fine>:51820
PersistentKeepalive=0
AllowedIPs={{10.144.60.0 fffffc00}}
AllowedIPs={{fd00:c6f2:a99b:d600:: ffffffffffffffff0000000000000000}}

Cant say when it appeared but this commit works.

Checked a few more. Up to this still works.

naggie commented 2 years ago

Thanks @Snowb1ind -- now looking into it

naggie commented 2 years ago

@botto this was caused by https://github.com/naggie/dsnet/pull/59

Here's the output before and after image

image

Note the IPv4 address is <nil> too.

botto commented 2 years ago

Oh, that's not good! I will fix this is asap

naggie commented 2 years ago

Thanks!

botto commented 2 years ago

Hi @Snowb1ind That should be fixed now, apologies for the inconvenience

botto commented 2 years ago

Please close the issue if it works for you too. I'll do a point release with the fix

naggie commented 2 years ago

Thanks @botto please PR it in or push it straight to master. I guess we should add a regression test or at least a sanity check for the generated config

botto commented 2 years ago

Hahaha, I pushed to origin which was my own repo. Yeah the testing is something I've thought about for a while. I have the test harness I use on dsnet-gui and maybe we could do something around that and send traffic across a small wireguard network

naggie commented 2 years ago

That's a really good idea. There's no better integration test than actually trying to pass traffic!

Snowb1ind commented 2 years ago

Forgot to reply. Works perfectly now. Thank you guys 🔥