IP_FREEBIND(2const) IP_FREEBIND(2const)

IP_FREEBIND - bind to a nonlocal or nonexistent IP address

Standard C library (libc-lc)

#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>
int setsockopt(int sockfd, IPPROTO_IP, IP_FREEBIND,
               const int *enable, sizeof(int));

If enabled, this boolean option allows binding to an IP address that is nonlocal or does not (yet) exist.

This permits listening on a socket, without requiring the underlying network interface or the specified dynamic IP address to be up at the time that the application is trying to bind to it.

This option is the per-socket equivalent of the /proc/sys/net/ipv4/ip_nonlocal_bind interface.

See IPPROTO_IP(2const). See setsockopt(2). See ip(7).

Linux.

Linux 2.4.

IPPROTO_IP(2const), setsockopt(2), proc_sys_net_ipv4(5), ip(7)

2025-11-25 Linux man-pages 6.17