Error Codes Wiki

Linux errno 99 EADDRNOTAVAIL — Cannot Assign Requested Address

Errorerrno

Overview

Linux errno 99 (EADDRNOTAVAIL) occurs when a program tries to bind to an IP address not assigned to any local network interface.

Key Details

  • EADDRNOTAVAIL is errno 99 on Linux
  • Most common when binding a socket to a specific IP address
  • The IP address is not configured on any network interface
  • Can occur when connecting and the system runs out of ephemeral ports
  • IPv6 addresses not yet configured trigger this during DAD (Duplicate Address Detection)

Common Causes

  • Application configured with an IP address not assigned to the machine
  • Network interface lost its IP (DHCP lease expired)
  • All ephemeral ports exhausted (over 28,000 connections)
  • IPv6 address in tentative state during DAD
  • VPN or network configuration change removing the bound IP

Steps

  1. 1Check assigned IPs: ip addr show
  2. 2Verify the application config matches an actual interface IP or use 0.0.0.0 to bind to all
  3. 3Check ephemeral port range: cat /proc/sys/net/ipv4/ip_local_port_range
  4. 4Increase ephemeral port range: echo '1024 65535' > /proc/sys/net/ipv4/ip_local_port_range
  5. 5Enable port reuse: set SO_REUSEADDR socket option in the application

Tags

linuxerrnoeaddrnotavailsocketnetworking

More in Errno

Frequently Asked Questions

A temporary port assigned by the OS for outgoing connections. Linux defaults to ports 32768-60999. High connection rates can exhaust them.