XTLS/Xray-core · error

automatic outbound interface selection is not supported on…

Error message

automatic outbound interface selection is not supported on this platform

What it means

Returned by the FreeBSD findOutboundInterface when no fixed interface name is configured. FreeBSD auto-discovery of the default-route interface for TUN outbound traffic is not implemented, so an empty fixedName short-circuits with this error and forces explicit configuration.

Solutions

  1. Set an explicit outbound interface name in the TUN settings (the physical NIC such as em0/igb0)
  2. Manually configure routing/policy rules so TUN-routed traffic leaves via the intended interface
  3. Contribute an automatic default-route detection routine for FreeBSD in findOutboundInterface
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/tun/tun_freebsd.go:153 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/462cdad3b9de0686. Report an issue: GitHub.

Appendix: source

Thrown at proxy/tun/tun_freebsd.go:153

	}), nil
}

// Wait some cpu cycles
func (t *FreeBSDTun) Wait() {
	procyield(1)
}

func (t *FreeBSDTun) newEndpoint() (stack.LinkEndpoint, error) {
	return &LinkEndpoint{deviceMTU: t.mtu, device: t}, nil
}

func setinterface(network, address string, fd uintptr, iface *net.Interface) error {
	return nil
}

func findOutboundInterface(tunIndex int, fixedName string) (*net.Interface, error) {
	if fixedName == "" {
		return nil, errors.New("automatic outbound interface selection is not supported on this platform")
	}
	iface, err := net.InterfaceByName(fixedName)
	if err != nil {
		return nil, err
	}
	if iface.Index == tunIndex {
		return nil, errors.New("outbound interface cannot be the TUN interface")
	}
	return iface, nil
}

View on GitHub (pinned to 7d214f8b09)