Make IP prefix configurable

This commit makes the IP prefix used to generate addresses configurable
to users. This can be useful if you would like to use a smaller range or
if your current setup is overlapping with the current range.

The current range is left as a default
This commit is contained in:
Kristoffer Dalby 2021-08-02 20:06:26 +01:00
parent 6c903d4a2f
commit 309f868a21
4 changed files with 15 additions and 5 deletions

View file

@ -6,6 +6,7 @@ import (
"testing"
"gopkg.in/check.v1"
"inet.af/netaddr"
)
func Test(t *testing.T) {
@ -36,7 +37,9 @@ func (s *Suite) ResetDB(c *check.C) {
if err != nil {
c.Fatal(err)
}
cfg := Config{}
cfg := Config{
IPPrefix: netaddr.MustParseIPPrefix("127.0.0.1/32"),
}
h = Headscale{
cfg: cfg,