{"record":{"id":"bb6d3befb43c3f0e","repo":"netbirdio/netbird","slug":"remove-output-dnat-w","errorCode":null,"errorMessage":"remove output DNAT: %w","messagePattern":"remove output DNAT: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/manager_linux.go","lineNumber":514,"sourceCode":"\tdefer m.mutex.Unlock()\n\n\tif localAddr.Is6() {\n\t\tif !m.hasIPv6() {\n\t\t\treturn fmt.Errorf(\"add output DNAT: %w\", firewall.ErrIPv6NotInitialized)\n\t\t}\n\t\treturn m.router6.AddOutputDNAT(localAddr, protocol, originalPort, translatedPort)\n\t}\n\treturn m.router.AddOutputDNAT(localAddr, protocol, originalPort, translatedPort)\n}\n\n// RemoveOutputDNAT removes an OUTPUT chain DNAT rule.\nfunc (m *Manager) RemoveOutputDNAT(localAddr netip.Addr, protocol firewall.Protocol, originalPort, translatedPort uint16) error {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\n\tif localAddr.Is6() {\n\t\tif !m.hasIPv6() {\n\t\t\treturn fmt.Errorf(\"remove output DNAT: %w\", firewall.ErrIPv6NotInitialized)\n\t\t}\n\t\treturn m.router6.RemoveOutputDNAT(localAddr, protocol, originalPort, translatedPort)\n\t}\n\treturn m.router.RemoveOutputDNAT(localAddr, protocol, originalPort, translatedPort)\n}\n\nconst (\n\tchainNameRaw = \"NETBIRD-RAW\"\n\tchainOUTPUT  = \"OUTPUT\"\n\ttableRaw     = \"raw\"\n)\n\n// SetupEBPFProxyNoTrack creates notrack rules for eBPF proxy loopback traffic.\n// This prevents conntrack from tracking WireGuard proxy traffic on loopback, which\n// can interfere with MASQUERADE rules (e.g., from container runtimes like Podman/netavark).\n//\n// Traffic flows that need NOTRACK:\n//","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/manager_linux.go#L496-L532","documentation":"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.","triggerScenarios":"Thrown at client/firewall/iptables/manager_linux.go:514 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}