.\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH IP_MULTICAST_TTL 2const 2025-11-25 "Linux man-pages 6.17" .SH NAME IP_MULTICAST_TTL \- time-to-live value of outgoing multicast packets .SH LIBRARY Standard C library .RI ( libc ,\~ \-lc ) .SH SYNOPSIS .nf .BR "#include " " /* Definition of " IP* " constants */" .B #include .P .BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_MULTICAST_TTL, .BI " const\~int\~*" ttl ,\~sizeof(int)); .BI int\~getsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_MULTICAST_TTL, .BI " int\~*" ttl ,\~sizeof(int)); .fi .SH DESCRIPTION Set or read the time-to-live value of outgoing multicast packets for this socket. .P The default is 1 which means that multicast packets don't leave the local network unless the user program explicitly requests it. .SH ERRORS See .BR IPPROTO_IP (2const). See .BR setsockopt (2). See .BR ip (7). .SH HISTORY Linux 1.2. .SH CAVEATS It is very important for multicast packets to set the smallest TTL possible. .SH SEE ALSO .BR IPPROTO_IP (2const), .BR setsockopt (2), .BR ip (7)