netbirdio/netbird · error

add addr

Error message

add addr %s: %w

What it means

netlink.AddrAdd failed to add the given prefix to the interface; the EEXIST case is handled separately (logged as already assigned), so this error represents a genuine add failure such as invalid prefix or permission. The remaining address assignment is aborted.

Solutions

  1. Check the prefix and family match the link
  2. Verify the address is not invalid (e.g. broadcast or network address)
  3. Retry the assignment
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at client/iface/device/wg_link_linux.go:148 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/2ea1c8c006e05281. Report an issue: GitHub.

Appendix: source

Thrown at client/iface/device/wg_link_linux.go:148

	}

	return nil
}

func (l *wgLink) addAddr(ifaceName string, prefix netip.Prefix) error {
	log.Debugf("adding address %s to interface: %s", prefix, ifaceName)

	addr := &netlink.Addr{
		IPNet: &net.IPNet{
			IP:   prefix.Addr().AsSlice(),
			Mask: net.CIDRMask(prefix.Bits(), prefix.Addr().BitLen()),
		},
	}

	if err := netlink.AddrAdd(l, addr); os.IsExist(err) {
		log.Infof("interface %s already has the address: %s", ifaceName, prefix)
	} else if err != nil {
		return fmt.Errorf("add addr %s: %w", prefix, err)
	}

	return nil
}

View on GitHub (pinned to 93e97f4bf1)