---
name: "IP_BIND_ADDRESS_NO_PORT"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/IP_BIND_ADDRESS_NO_PORT"
---

# IP\_BIND\_ADDRESS\_NO\_PORT(2const)

don't reserve an ephemeral port

## NAME

IP\_BIND\_ADDRESS\_NO\_PORT - don't reserve an ephemeral port

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>
```

**int setsockopt(int** *sockfd***, IPPROTO\_IP, IP\_BIND\_ADDRESS\_NO\_PORT,**                **const int \****enable***, sizeof(int));**

## DESCRIPTION

Inform the kernel to not reserve an ephemeral port when using [**bind**(2)](/bind/2.md) with a port number of 0. The port will later be automatically chosen at [**connect**(2)](/connect/2.md) time, in a way that allows sharing a source port as long as the 4-tuple is unique.

## ERRORS

See [**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md). See [**setsockopt**(2)](/setsockopt/2.md). See [**ip**(7)](/ip/7.md).

## HISTORY

Linux 4.2.

## SEE ALSO

[**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md), [**setsockopt**(2)](/setsockopt/2.md), [**ip**(7)](/ip/7.md)
