netbirdio/netbird · error

last ip

Error message

last ip: %w

What it means

GetLastIPFromNetwork failed while create() derived the DNS listener address (last address of the overlay network) from the assigned netstack address. Without this address the embedded DNS server has nothing to bind to, so netstack device creation aborts before building the TUN.

Solutions

  1. Verify the overlay network prefix is valid and large enough
  2. Check the address family of the configured network
  3. Fix the network configuration and recreate the device
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at client/iface/device/device_netstack.go:64 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/e29f309d9822c661. Report an issue: GitHub.

Appendix: source

Thrown at client/iface/device/device_netstack.go:64

func NewNetstackDevice(name string, address wgaddr.Address, wgPort int, key string, mtu uint16, bind Bind, listenAddress string) *TunNetstackDevice {
	return &TunNetstackDevice{
		name:          name,
		address:       address,
		port:          wgPort,
		key:           key,
		mtu:           mtu,
		listenAddress: listenAddress,
		bind:          bind,
	}
}

func (t *TunNetstackDevice) create() (WGConfigurer, error) {
	log.Info("create nbnetstack tun interface")

	// TODO: get from service listener runtime IP
	dnsAddr, err := nbnet.GetLastIPFromNetwork(t.address.Network, 1)
	if err != nil {
		return nil, fmt.Errorf("last ip: %w", err)
	}

	addresses := []netip.Addr{t.address.IP}
	if t.address.HasIPv6() {
		addresses = append(addresses, t.address.IPv6)
	}
	log.Debugf("netstack using addresses: %v", addresses)
	t.nsTun = nbnetstack.NewNetStackTun(t.listenAddress, addresses, dnsAddr, int(t.mtu))
	log.Debugf("netstack using dns address: %s", dnsAddr)
	tunIface, net, err := t.nsTun.Create()
	if err != nil {
		return nil, fmt.Errorf("error creating tun device: %s", err)
	}
	t.filteredDevice = newDeviceFilter(tunIface)
	t.net = net

	t.device = device.NewDevice(
		t.filteredDevice,

View on GitHub (pinned to 93e97f4bf1)