Skip to content

Commit

Permalink
fix(wireguard): point to Kubernetes wiki if encountering IP rule file…
Browse files Browse the repository at this point in the history
… exists error
  • Loading branch information
qdm12 committed Nov 15, 2024
1 parent 36bb368 commit 077cf99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/wireguard/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package wireguard

import (
"fmt"
"strings"

"github.com/qdm12/gluetun/internal/netlink"
)
Expand All @@ -16,6 +17,10 @@ func (w *Wireguard) addRule(rulePriority int, firewallMark uint32,
rule.Table = int(firewallMark)
rule.Family = family
if err := w.netlink.RuleAdd(rule); err != nil {
if strings.HasSuffix(err.Error(), "file exists") {
w.logger.Info("if you are using Kubernetes, this may fix the error below: " +
"https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/kubernetes.md#adding-ipv6-rule--file-exists")
}
return nil, fmt.Errorf("adding %s: %w", rule, err)
}

Expand Down

0 comments on commit 077cf99

Please sign in to comment.