---
name: "IP_MULTICAST_TTL"
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_MULTICAST_TTL"
---

# IP\_MULTICAST\_TTL(2const)

time-to-live value of outgoing multicast packets

## NAME

IP\_MULTICAST\_TTL - time-to-live value of outgoing multicast packets

## 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\_MULTICAST\_TTL,**                **const int \****ttl***, sizeof(int));** **int getsockopt(int** *sockfd***, IPPROTO\_IP, IP\_MULTICAST\_TTL,**                **int \****ttl***, sizeof(int));**

## DESCRIPTION

Set or read the time-to-live value of outgoing multicast packets for this socket.

The default is 1 which means that multicast packets don't leave the local network unless the user program explicitly requests it.

## ERRORS

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

## HISTORY

Linux 1.2.

## CAVEATS

It is very important for multicast packets to set the smallest TTL possible.

## SEE ALSO

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