netbirdio/netbird · error

add v4 address: %s: %w

Error message

add v4 address: %s: %w

What it means

Error "add v4 address: %s: %w" thrown in netbirdio/netbird.

Source

Thrown at client/iface/device/device_darwin.go:135

}

func (t *TunDevice) DeviceName() string {
	return t.name
}

func (t *TunDevice) FilteredDevice() *FilteredDevice {
	return t.filteredDevice
}

// Device returns the wireguard device
func (t *TunDevice) Device() *device.Device {
	return t.device
}

// assignAddr Adds IP address to the tunnel interface and network route based on the range provided
func (t *TunDevice) assignAddr() error {
	if out, err := exec.Command("ifconfig", t.name, "inet", t.address.IP.String(), t.address.IP.String()).CombinedOutput(); err != nil {
		return fmt.Errorf("add v4 address: %s: %w", string(out), err)
	}

	// Assign a dummy link-local so macOS enables IPv6 on the tun device.
	// When a real overlay v6 is present, use that instead.
	v6Addr := "fe80::/64"
	if t.address.HasIPv6() {
		v6Addr = t.address.IPv6String()
	}
	if out, err := exec.Command("ifconfig", t.name, "inet6", v6Addr).CombinedOutput(); err != nil {
		log.Warnf("failed to assign IPv6 address %s, continuing v4-only: %s: %v", v6Addr, string(out), err)
		t.address.ClearIPv6()
	}

	if out, err := exec.Command("route", "add", "-net", t.address.Network.String(), "-interface", t.name).CombinedOutput(); err != nil {
		return fmt.Errorf("add route %s via %s: %s: %w", t.address.Network, t.name, string(out), err)
	}

	if t.address.HasIPv6() {

View on GitHub (pinned to 93e97f4bf1)

When it happens

Trigger: Thrown at client/iface/device/device_darwin.go:135 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/9de9e40a48ed14f6. Report an issue: GitHub.