Fixing things

This commit is contained in:
Fabian Stamm 2021-12-11 22:18:30 +01:00
parent ae6e87aadc
commit cb507c7710
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
config.json
out/
wg_generate

4
gen.go
View File

@ -45,7 +45,7 @@ func generateConfigs(storage *Storage) {
serverConfig := ""
serverConfig += "[Interface]\n"
serverConfig += fmt.Sprintf("ListenPort = %d\n", storage.Port)
serverConfig += fmt.Sprintf("Address = %s1/32,%s1/128\n", storage.Subnet, storage.Subnet6)
serverConfig += fmt.Sprintf("Address = %s1/24,%s1/68\n", storage.Subnet, storage.Subnet6)
serverConfig += fmt.Sprintf("PrivateKey = %s\n", storage.Server.Private)
if len(storage.Server.IPTablesUp) > 0 {
@ -78,7 +78,7 @@ func generateConfigs(storage *Storage) {
peerConfig += fmt.Sprintf("[Peer] # Server\n")
peerConfig += fmt.Sprintf("PublicKey = %s\n", storage.Server.Public)
if !peer.OnlySubnet {
peerConfig += fmt.Sprintf("AllowedIPs = 0.0.0.0/0, ::0/0\n")
peerConfig += fmt.Sprintf("AllowedIPs = 0.0.0.0/0, ::/0\n")
} else {
peerConfig += fmt.Sprintf("AllowedIPs = %s0/24, %s0/68\n", storage.Subnet, storage.Subnet6)
}