SO_BINDTODEVICE
SO_BINDTODEVICE binds a socket to a specific network interface (e.g., eth0) so traffic is sent and received only through that interface.
Purpose
It selects the egress interface in multi-NIC environments, used for VPNs, routing, and interface isolation.
Mechanism
setsockopt(SOL_SOCKET, SO_BINDTODEVICE, ifname) binds the socket to the named interface, restricting all sends and receives to it. It requires root privileges and is used for policy routing and interface-pinned services.
Use cases
- Multi-NIC routing control
- VPN interface binding
- Network isolation
Related tools
HTTP Status Codes
Reference table of common HTTP status codes (1xx-5xx) with names, categories, and descriptions. Free, private, and 100% client-side. TOOL
URL Parser
Parse a URL into its components: protocol, host, path, query, hash, port, username, and password. Free, private, and 100% client-side. TOOL