slackhq/nebula · error
failed to get ip interface: %w
Error message
failed to get ip interface: %w
What it means
addRoutes failed to retrieve the IPv4 IP interface for the TUN adapter via luid.IPInterface(windows.AF_INET). The library wraps the winipcfg error before applying MTU/metric settings. Getting this means the interface disappeared or is not fully initialized in Windows.
Source
Thrown at overlay/tun_windows.go:215
retErr.Log(t.l)
continue
} else {
return retErr
}
} else {
t.l.Info("Added route", "route", r)
}
if !foundDefault4 {
if r.Cidr.Bits() == 0 && r.Cidr.Addr().BitLen() == 32 {
foundDefault4 = true
}
}
}
ipif, err := luid.IPInterface(windows.AF_INET)
if err != nil {
return fmt.Errorf("failed to get ip interface: %w", err)
}
ipif.NLMTU = uint32(t.MTU)
if foundDefault4 {
ipif.UseAutomaticMetric = false
ipif.Metric = 0
}
if err := ipif.Set(); err != nil {
return fmt.Errorf("failed to set ip interface: %w", err)
}
return nil
}
func (t *winTun) removeRoutes(routes []Route) error {
luid := winipcfg.LUID(t.tun.LUID())
for _, r := range routes {View on GitHub (pinned to dd8f660c0a)
Solutions
- Restart the nebula service to recreate the TUN device
- Check the adapter exists and is enabled in Device Manager / Get-NetAdapter
- Disable conflicting VPN/filter software that tears down wintun adapters
- Verify the wrapped error code (ERROR_NOT_FOUND usually = adapter gone)
- Update wintun driver if failures recur after sleep/resume
Defensive patterns
Strategy: retry
Validate before calling
// confirm the adapter is present before route setup
adapters, _ := winipcfg.GetAdaptersAddresses(windows.AF_INET, 0)
found := false
for _, a := range adapters {
if a.LUID == luid { found = true }
}
if !found { return errors.New("TUN adapter vanished before route setup") } Try / catch
if err := tun.Activate(); err != nil {
if strings.Contains(err.Error(), "failed to get ip interface") {
time.Sleep(500 * time.Millisecond)
return tun.Activate() // retry after adapter settles
}
return err
} Prevention
- Disable software that removes wintun adapters (some AV/VPN tools)
- Avoid reloading config while the adapter is being torn down
- Recreate the TUN if the interface disappears
- Check adapter state after sleep/resume
When it happens
Trigger: Called from Activate() or reload() when luid.IPInterface(windows.AF_INET) fails — typically because the adapter was removed, is disabled, or the LUID is no longer valid at route-config time.
Common situations: VPN adapter deleted by antivirus/VPN conflict software between creation and route setup; adapter disabled; rapid reload racing with teardown; driver in a bad state after sleep/resume.
Related errors
- failed to set ip interface: %w
- create TUN device failed: %w
- failed to set address: %w
- FwpmFilterAdd0: 0x%x
- ErrInvalidLocalIP
AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03).
Data as JSON: /api/errors/0efbd70119e1fc84.
Report an issue: GitHub.