IP_TRANSPARENT(2const)

πŸ“¦
version 6.20 Β· 4 versions
, in arch rolling, nixpkgs unstable

πŸ’… IP_TRANSPARENT β€” bestie's guide to transparent proxying

okay so real talk, this is IP_TRANSPARENT(2const), a lil page from section 2const of the Linux manual, and it's literally about transparent proxying. yes that's the whole vibe. sit down, grab a πŸ“, let's go.


✨ NAME ✨

IP_TRANSPARENT β€” transparent proxying. that's it, that's the name, iconic.


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc). the classics, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

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

int setsockopt(int sockfd, IPPROTO_IP, IP_TRANSPARENT,
               const int *enable, sizeof(int));

look at her. so clean. so structured. 🫢


🌸 DESCRIPTION 🌸

okay so setting this boolean option is what turns on transparent proxying for this socket. like, that's the whole moment.

the way that this socket option works is: it lets the calling application bind to a nonlocal IP address and then operate as both a client and a server, with that foreign address as the local endpoint. yes bestie, both roles, at the same time, main character energy only. πŸ‘‘

but!!! πŸ™ˆ this requires that routing be set up in a way that packets going to the foreign address are routed through the TProxy box β€” and the TProxy box is, quote unquote, the system hosting the application that employs the IP_TRANSPARENT socket option. so like, the routing has to actually be done, this isn't a vibes-based thing.

enabling this socket option requires superuser privileges β€” specifically the CAP_NET_ADMIN or CAP_NET_RAW capability. no privilege, no transparency, sorry queen. πŸ’€

also if you're doing TProxy redirection with the iptables TPROXY target, that also requires that this option be set on the redirected socket. two things, both necessary, periodt.


πŸ¦‹ ERRORS πŸ¦‹

that's the list. go read those if something's acting up. ✨


⭐ STANDARDS ⭐

Linux. just Linux. that's the standard. πŸ‡±


🌈 HISTORY 🌈

Linux 2.6.24. she's been around since forever and she's still serving. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie, no notes. πŸŽ€ this was Linux man-pages 6.20, dated 2025-11-25, and I am obsessed. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms