netbirdio/netbird · error

got error when getting ip interface %s

Error message

got error when getting ip interface %s

What it means

Windows Create() queries the adapter's IPv4 interface row via winipcfg LUID.IPInterface(windows.AF_INET) (GetIpInterfaceEntry) right after adapter creation, to set the tunnel MTU. This error means the Network Localization API could not return that row; the wireguard-go device is closed and creation aborts. The IPv6 twin query later is soft (warn plus ClearIPv6), but this IPv4 query is fatal.

Source

Thrown at client/iface/device/device_windows.go:82

	if err != nil {
		return nil, fmt.Errorf("error creating tun device: %s", err)
	}
	t.nativeTunDevice = tunDevice.(*tun.NativeTun)
	t.filteredDevice = newDeviceFilter(tunDevice)

	// We need to create a wireguard-go device and listen to configuration requests
	t.device = device.NewDevice(
		t.filteredDevice,
		t.iceBind,
		device.NewLogger(wgLogLevel(), "[netbird] "),
	)

	luid := winipcfg.LUID(t.nativeTunDevice.LUID())

	nbiface, err := luid.IPInterface(windows.AF_INET)
	if err != nil {
		t.device.Close()
		return nil, fmt.Errorf("got error when getting ip interface %s", err)
	}

	nbiface.NLMTU = uint32(t.mtu)

	err = nbiface.Set()
	if err != nil {
		t.device.Close()
		return nil, fmt.Errorf("set IPv4 interface MTU: %s", err)
	}

	if t.address.HasIPv6() {
		nbiface6, err := luid.IPInterface(windows.AF_INET6)
		if err != nil {
			log.Warnf("failed to get IPv6 interface for MTU, continuing v4-only: %v", err)
			t.address.ClearIPv6()
		} else {
			nbiface6.NLMTU = uint32(t.mtu)
			if err := nbiface6.Set(); err != nil {

View on GitHub (pinned to 93e97f4bf1)

Solutions

  1. Retry Create() once after a short delay; this is often a transient race
  2. Conflict-check third-party VPN/AV network filter drivers
  3. Update the wintun driver / NetBird client if it reproduces deterministically
  4. Check Windows Event Log (System) for adapter/driver errors at that timestamp
Defensive patterns

Strategy: retry

Try / catch

var row *winipcfg.MibIPInterfaceRow
err := retry(3, 250*time.Millisecond, func() error {
    r, e := luid.IPInterface(windows.AF_INET)
    row = r
    return e
})
if err != nil {
    return fmt.Errorf("ip interface row unavailable: %w", err)
}

Prevention

When it happens

Trigger: The adapter vanished between creation and the query (driver/AV interference), an invalid LUID, the IPv4 interface row not yet committed by the stack, or a transient winipcfg API error.

Common situations: Antivirus or third-party VPN filters tearing down adapters, slow driver initialization on busy hosts, adapter churn from repeated connect cycles.

Related errors


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/61d65275824af0ea. Report an issue: GitHub.