Homelab Academy / Modules
Learn: instruction, vocabulary, worked example.
Module: Download Clients & Indexers
Activity type: Reading (Learn)
Objective: Explain why an application bound to a VPN address is not automatically protected after that address or interface disappears.
| Term | Meaning |
|---|---|
| VPN tunnel | A logical network path that encapsulates traffic between peers. A tunnel can be operational even when individual applications are not using it. |
| Socket binding | Associating a socket with a local address or, on supported systems, a specific interface. Address binding constrains the local source address but is not a complete egress security policy. |
| Wildcard bind | A bind to all local addresses, commonly represented by 0.0.0.0 for IPv4 or :: for IPv6. For listeners this accepts traffic on multiple interfaces; for outbound applications, behavior depends on the application and operating system. |
| Policy routing | Route selection based on rules beyond the destination alone, such as source address, packet mark, or incoming interface. |
| Kill switch | A fail-closed network policy that prevents protected traffic from using an unauthorized path when the VPN is unavailable or misconfigured. |
| Control-plane exception | A narrowly scoped allowance needed to establish and maintain the VPN itself, such as traffic to a specific VPN endpoint through the physical uplink. |
| DNS leak | Name-resolution traffic reaching a resolver through an unauthorized interface or outside the intended encrypted path. |
| IPv6 leak | IPv6 traffic bypassing an IPv4-only tunnel or policy because IPv6 remains available through another interface. |
| Fail-open | A failure mode in which protected traffic falls back to an ordinary network path after the preferred secure path disappears. |
| Fail-closed | A failure mode in which protected traffic is denied when the authorized secure path is unavailable. |
| Negative test | A test that deliberately removes or breaks an expected dependency and confirms that prohibited behavior remains impossible. |
| Leak verification | Evidence-driven testing of addresses, routes, DNS paths, protocol families, and failure behavior rather than reliance on a VPN connected indicator. |
VPN privacy is a path-enforcement problem, not merely a tunnel-status problem. An application can report that it is bound to a VPN address while another subsystem still uses the ordinary uplink. Conversely, a host default route can point through a VPN while a policy-routing rule, container namespace, explicit proxy, IPv6 route, or privileged application selects another path. Treat application binding, route selection, and packet filtering as separate controls. Binding narrows where a socket may originate or listen. Routing determines the candidate path. A host packet filter enforces whether the selected path is permitted. Defense in depth uses all three where practical, but the packet filter is normally the final fail-closed control.
A useful kill-switch design begins with an explicit traffic inventory. Identify the protected process or service identity, the tunnel interface, the VPN endpoint address and port, DNS resolvers, local management networks, and any intentionally reachable LAN services. Start from deny-by-default for protected egress, then add narrow allowances. The VPN control-plane exception must normally use the physical uplink so the tunnel can be created. That exception should be limited to the actual endpoint, transport, and port rather than allowing arbitrary Internet traffic. Protected data traffic is then allowed only through the tunnel. If the endpoint is named rather than addressed directly, bootstrap DNS becomes part of the threat model and must be handled deliberately.
Binding to a VPN address is helpful but incomplete. If software cannot create a socket after the address disappears, it may fail safely; however, implementations differ, long-lived sockets may behave differently, and a restarted application may choose another address unless policy prevents it. Binding only IPv4 does not constrain IPv6. Binding a service listener also answers an inbound-exposure question, which is different from controlling outbound connections. Interface-based binding can be stronger on supported systems, but it may require privileges and still should not replace egress enforcement.
Verification must test both success and failure. While the VPN is healthy, inspect the selected route, local source address, resolver path, IPv4 behavior, IPv6 behavior, and application-specific proxy settings. Then remove the modeled VPN path and confirm that protected traffic stops rather than moving to the uplink. Repeat after application restart, VPN restart, address changes, and host reboot. Containers and virtual machines need separate inspection because they may have their own routes and packet-filter traversal. Browser WebRTC, encrypted DNS, and extension-managed proxies can also behave differently from ordinary command-line traffic. A public IP-check page is only one observation; it does not prove that DNS, IPv6, alternate processes, or failure transitions are protected. The lab below is deliberately a local policy simulation. It teaches test design without changing routes, interfaces, DNS, or host enforcement, and its report must not be represented as proof that the real host is leak-free.
Application layer
Selects the intended local VPN address or interface and avoids unrestricted fallback behavior.
Routing layer
Selects the tunnel for protected destinations and accounts for source-based rules, packet marks, and alternate routing tables.
Enforcement layer
Allows the VPN control plane through the uplink, permits protected data through the tunnel, and denies unauthorized egress.
Name-resolution layer
Ensures DNS requests use an approved resolver over an approved path.
Verification layer
Tests IPv4, IPv6, DNS, application traffic, restart behavior, and tunnel-loss behavior.
The physical uplink reaches only the configured VPN endpoint for tunnel establishment, plus explicitly approved local-management destinations.
The VPN client creates the logical tunnel interface and installs or activates the intended routing policy.
The protected application uses a VPN-local source or is classified by a process, user, namespace, or packet mark.
Protected data may leave only through the VPN interface.
DNS follows the VPN path or is blocked if the approved resolver is unavailable.
When the tunnel disappears, protected traffic is denied rather than rerouted through the uplink.
Between the protected application and the host networking stack.
Between the host routing decision and packet-filter enforcement.
Between the physical uplink and the VPN tunnel.
Between the host and container or virtual-machine network namespaces.
Between applications and any locally or remotely configured DNS resolver.