Skip to content

Commit

Permalink
Merge pull request #322 from SlyngDK/port-mapping-lifetime
Browse files Browse the repository at this point in the history
Changed add port mapping lifetime config and changed default to 24h
  • Loading branch information
SlyngDK authored Jan 2, 2023
2 parents 475399f + 37edf4b commit b6fe22f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/agent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func natPMP(config *conf.C) {
return
}

portMapping, err := client.AddPortMapping("udp", nebulaPort, 0, 120)
portMapping, err := client.AddPortMapping("udp", nebulaPort, 0, int(config.GetDuration("service.port_mapping.lifetime", 24*time.Hour).Seconds()))
if err != nil {
fmt.Printf("%s\n", err)
return
Expand Down
1 change: 1 addition & 0 deletions examples/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ service:
# port_mapping:
# enabled: true
# gateway: 192.168.56.101
# lifetime: 24h

#enroll:
# groups: ["test"]
Expand Down

0 comments on commit b6fe22f

Please sign in to comment.