Skip to content

Commit

Permalink
fix(wireguard): point to Kubernetes wiki page when encountering IP ru…
Browse files Browse the repository at this point in the history
…le add file exists error (#2526)
  • Loading branch information
qdm12 authored Nov 15, 2024
1 parent 3790034 commit fdd4991
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 fdd4991

Please sign in to comment.