netbirdio/netbird · error

generate route rule spec: %w

Error message

generate route rule spec: %w

What it means

Error "generate route rule spec: %w" thrown in netbirdio/netbird.

Source

Thrown at client/firewall/iptables/router_linux.go:172

	var source firewall.Network
	if len(sources) > 1 {
		source.Set = firewall.NewPrefixSet(sources)
	} else if len(sources) > 0 {
		source.Prefix = sources[0]
	}

	params := routeFilteringRuleParams{
		Source:      source,
		Destination: destination,
		Proto:       proto,
		SPort:       sPort,
		DPort:       dPort,
		Action:      action,
	}

	rule, err := r.genRouteRuleSpec(params, sources)
	if err != nil {
		return nil, fmt.Errorf("generate route rule spec: %w", err)
	}

	// Insert DROP rules at the beginning, append ACCEPT rules at the end
	if action == firewall.ActionDrop {
		// after the established rule
		err = r.iptablesClient.Insert(tableFilter, chainRTFWDIN, 2, rule...)
	} else {
		err = r.iptablesClient.Append(tableFilter, chainRTFWDIN, rule...)
	}

	if err != nil {
		return nil, fmt.Errorf("add route rule: %v", err)
	}

	r.rules[string(ruleKey)] = rule

	r.updateState()

View on GitHub (pinned to 93e97f4bf1)

When it happens

Trigger: Thrown at client/firewall/iptables/router_linux.go:172 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/af8f97147034444c. Report an issue: GitHub.