You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
First of all, thanks for making this. This is a really interesting project.
I was wondering how hard it would be to support IPv6-only subnets. By the looks of it, only https://github.com/skx/simple-vpn/blob/master/cmd_server.go#L170 assumes IPv4 and that's because we treat it like a string instead of like an IP address.
The use-case is when using simple-vpn within another private subnet, using IPv6-only makes it easy to pick an IP block that won't clash with the rest of the subnet.
Would you be able to support this use-case? Open to PRs?
Ahh Mac OS X is probably going to cause you some pain :/
I see the same thing:
frodo ~/go/src/github.com/skx/simple-vpn $ GOOS=darwin GOARCH=amd64 go build .
./cmd_server.go:285:11: tapConfig.Name undefined (type water.Config has no field or method Name)
Ha, hit an OOM trying to start the server using a relatively "small" subnet like subnet = fde4:8dba:82e1:fefe::/64 because it tried to create the assigned map with 2^64 entries 😆
A couple of options to deal with this:
Limit the size of IPv6 subnets that can be used to /108 (a million IPs should be OK?). I tested this, it works reasonably well. No OOMs.
Lazily init the map, start with a max of X entries and then add more if you're out of unassigned IPs and there are IPs left in the subnet. This can still hit an OOM if you end up a with lot of clients though I don't imagine you're looking to support billions of clients.
I think it's OK to call out the limitation and just use smaller subnets. What do you think?
I think I'd go for the second choice, because people will assume /64s - that's the most common routed range for IPv6 after all. (Pretty much the same as using a /32.)
So lazy allocation seems like it would make most sense.
Activity
skx commentedon Feb 20, 2019
I'd be open to a pull-request which allowed the CIDR range to be an IPv6 range, presumably within
fd00::/8as a /48 or /64.For example:
or:
Instead of:
Ranges picked via the unique local address-ranges.
I think there shouldn't be too many changes required, but I'd probably not make them alone.
samridh90 commentedon Feb 20, 2019
I was trying to setup the project locally and I get the following error when I try to get dependencies:
Did the
waterlibrary change their interface for tapConfig? It might be worth usingdepto lock down the dependencies to specific versionsskx commentedon Feb 20, 2019
Works for me, on a fresh host:
I'll assume you're on Linux, if you're not that might explain it. Otherwise I see you ran "
go get ./...", but not "go build ..".samridh90 commentedon Feb 20, 2019
Thanks for checking, what version of golang are you using? I'll ensure I'm using the same version.
Edit: I'm on Mac OS X
skx commentedon Feb 20, 2019
skx commentedon Feb 20, 2019
Ahh Mac OS X is probably going to cause you some pain :/
I see the same thing:
Looks like that's noted in the source:
skx commentedon Feb 20, 2019
You'd need to switch to tun-based stuff instead of tap-based stuff, and I'm not sure how much would be required to change :/
samridh90 commentedon Feb 20, 2019
That's OK, I'll use a linux VM instead. Easy enough to switch
samridh90 commentedon Feb 21, 2019
Ha, hit an OOM trying to start the server using a relatively "small" subnet like
subnet = fde4:8dba:82e1:fefe::/64because it tried to create theassignedmap with 2^64 entries 😆A couple of options to deal with this:
I think it's OK to call out the limitation and just use smaller subnets. What do you think?
skx commentedon Feb 21, 2019
I think I'd go for the second choice, because people will assume /64s - that's the most common routed range for IPv6 after all. (Pretty much the same as using a /32.)
So lazy allocation seems like it would make most sense.