netbirdio/netbird · error
remove v6 NAT rule
Error message
remove v6 NAT rule: %w
What it means
Wrapped error appended to a multierror accumulator when the IPv6 nftables router fails to remove the translated v6 NAT rule (a dynamic pair converted via firewall.ToV6NatPair) while tearing down NAT rules. It fires only when the host has IPv6 (m.hasIPv6()) and the pair is dynamic; the v4 removal has already been attempted and any v6 failure does not abort the remaining cleanup.
Solutions
- Inspect nftables state (nft list ruleset) to see whether the v6 NAT chain/rule was already removed or renamed, causing the delete to miss
- Check daemon logs for the underlying router6.RemoveNatRule error, which carries the netlink/nftables failure reason
- Restart the agent or re-apply the network map so the NAT manager reconciles and re-creates/removes rules from the current desired state
- If the interface was torn down out of band, run netbird down to force full cleanup of residual rules
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at client/firewall/nftables/manager_linux.go:427 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/f3149e7032f3297b.
Report an issue: GitHub.
Appendix: source
Thrown at client/firewall/nftables/manager_linux.go:427
defer m.mutex.Unlock()
if pair.Destination.IsPrefix() && pair.Destination.Prefix.Addr().Is6() {
if !m.hasIPv6() {
return nil
}
return m.router6.RemoveNatRule(pair)
}
var merr *multierror.Error
if err := m.router.RemoveNatRule(pair); err != nil {
merr = multierror.Append(merr, fmt.Errorf("remove v4 NAT rule: %w", err))
}
if m.hasIPv6() && pair.Dynamic {
v6Pair := firewall.ToV6NatPair(pair)
if err := m.router6.RemoveNatRule(v6Pair); err != nil {
merr = multierror.Append(merr, fmt.Errorf("remove v6 NAT rule: %w", err))
}
}
return nberrors.FormatErrorOrNil(merr)
}
// AllowNetbird allows netbird interface traffic.
// This is called when USPFilter wraps the native firewall, adding blanket accept
// rules so that packet filtering is handled in userspace instead of by netfilter.
//
// TODO: In USP mode this only adds ACCEPT to the netbird table's own chains,
// which doesn't override DROP rules in external tables (e.g. firewalld).
// Should add passthrough rules to external chains (like the native mode router's
// addExternalChainsRules does) for both the netbird table family and inet tables.
// The netbird table itself is fine (routing chains already exist there), but
// non-netbird tables with INPUT/FORWARD hooks can still DROP our WG traffic.
func (m *Manager) AllowNetbird() error {
m.mutex.Lock()View on GitHub (pinned to 93e97f4bf1)