Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wireguard): point to Kubernetes wiki if encountering IP rule file…
Browse files Browse the repository at this point in the history
… exists error
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
@@ -2,6 +2,7 @@ package wireguard

import (
"fmt"
"strings"

"github.com/qdm12/gluetun/internal/netlink"
)
@@ -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)
}

0 comments on commit 077cf99

Please sign in to comment.