netbirdio/netbird · error
remove output DNAT
Error message
remove output DNAT: %w
What it means
Removing an OUTPUT chain DNAT rule was refused because the address family is IPv6 but the v6 router was never initialized. The rule therefore cannot exist; the manager returns ErrIPv6NotInitialized rather than pretending success.
Solutions
- Treat as a signal that v6 was disabled after rules were planned; verify IPv6 config
- Skip v6 DNAT removal when the interface has no v6 address
- Re-enable IPv6 if v6 translation is expected
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at client/firewall/iptables/manager_linux.go:514 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/bb6d3befb43c3f0e.
Report an issue: GitHub.
Appendix: source
Thrown at client/firewall/iptables/manager_linux.go:514
defer m.mutex.Unlock()
if localAddr.Is6() {
if !m.hasIPv6() {
return fmt.Errorf("add output DNAT: %w", firewall.ErrIPv6NotInitialized)
}
return m.router6.AddOutputDNAT(localAddr, protocol, originalPort, translatedPort)
}
return m.router.AddOutputDNAT(localAddr, protocol, originalPort, translatedPort)
}
// RemoveOutputDNAT removes an OUTPUT chain DNAT rule.
func (m *Manager) RemoveOutputDNAT(localAddr netip.Addr, protocol firewall.Protocol, originalPort, translatedPort uint16) error {
m.mutex.Lock()
defer m.mutex.Unlock()
if localAddr.Is6() {
if !m.hasIPv6() {
return fmt.Errorf("remove output DNAT: %w", firewall.ErrIPv6NotInitialized)
}
return m.router6.RemoveOutputDNAT(localAddr, protocol, originalPort, translatedPort)
}
return m.router.RemoveOutputDNAT(localAddr, protocol, originalPort, translatedPort)
}
const (
chainNameRaw = "NETBIRD-RAW"
chainOUTPUT = "OUTPUT"
tableRaw = "raw"
)
// SetupEBPFProxyNoTrack creates notrack rules for eBPF proxy loopback traffic.
// This prevents conntrack from tracking WireGuard proxy traffic on loopback, which
// can interfere with MASQUERADE rules (e.g., from container runtimes like Podman/netavark).
//
// Traffic flows that need NOTRACK:
//View on GitHub (pinned to 93e97f4bf1)