Advanced IPv4 controls · Simple VPN and DNS policies
Use VPN 1’s supplied resolver for host-wide DNS and VPN 2 for selected application payload. Ordinary application payload remains direct.
Read Prepare an Advanced IPv4 Deployment, Repair Windows and Health Checks, and Operate, Restart and Withdraw alongside this guide. These advanced examples use dedicated systemd-managed OpenVPN instances; the simple walkthrough remains a separate alternative.
Follow the shared Ubuntu 24.04 implementation walkthrough for this use case: configuration, source build, guarded installation, controlled handoff, operating commands and rollback. Select ipv4 and this case in the source bundle. The policy below supplies its DNS scope, application boundaries and permitted failure behavior. OpenVPN Community 2.6 is the reference; exact-build capability checks remain required. Linux execution is deferred.
Define the policy
| Traffic | Required provider/path |
|---|---|
| Selected application DNS | VPN 1 supplied resolver through VPN 1 |
| Other application and host-service DNS | Same resolver through VPN 1 |
| Selected application payload | VPN 2 |
| Other application payload | Direct |
DNS scope: Host-wide upstream DNS. This covers conventional upstream unicast DNS in the declared host contexts. Controlled application resolution is required; port-53 filtering alone does not establish that arbitrary encrypted DNS or proxies cannot bypass it. Local stub access is not a separate upstream permission. Protected IPv6 is blocked during this IPv4 phase; the later IPv6 series is separate.
The two permissions for an application are independent. Losing DNS does not revoke healthy known-address payload, and losing payload does not revoke healthy DNS. A common tunnel, physical underlay or protection failure can affect both when both actually depend on it.
Prepare this use case
-
Assign separate OpenVPN units, management sockets, interfaces and ownership records to DNS VPN 1 and payload VPN 2. Do not identify them only by whichever interface appeared first.
-
Bind every host resolver context to the approved VPN 1 resolver. Prevent DNS through VPN 2 or direct, and prevent selected payload through VPN 1 or direct.
-
Record any shared physical underlay and common supervisor separately from the two VPN roles. Separate role health does not imply physical independence.
Complete the deployment worksheet with the shared preparation inventory. It is documentation data, not a loadable configuration. Retain the simple counterpart as an alternative; do not run its mode-switch helper beside the advanced owner.
Activate and observe
Follow the closed-first activation sequence. Install and verify the independent route restrictions before any controlled transport attempt or application grant. Admit only the named OpenVPN instance and numeric peer needed for this use case. Then qualify each DNS/payload class separately and read back the actual resolver/route selection in its client context.
At startup, each permitted class must release before its fifteen-minute allowance expires. Successful release begins its own 120-second confirmation. Record the selected provider, class state, OpenVPN invocation, current checks, attempt count and remaining authority; an interface or an “active” service alone does not prove useful traffic is flowing.
Respond to failure
| Observed condition | Required behavior |
|---|---|
| VPN 1 DNS service fails; both tunnels remain up | Close DNS only. Keep healthy known-address payload through VPN 2 and the ordinary direct route. |
| VPN 1 session fails | Close DNS using that session. Keep independently healthy VPN 2 payload. |
| VPN 2 payload fails | Close selected payload only. Keep VPN 1 DNS available to both groups. |
| Both roles fail | Maintain separate incident times and counters. Either class can requalify and reopen without waiting for the other. |
Unavailable, degraded and unknown required service all invoke the relevant loss response. Keep static no-escape restrictions installed before detection, during repair and after lockout. Use the shared repair rules and report the actual failure reason. A remote DNS error does not automatically authorize a tunnel restart.
Work through one incident
DNS loss is classified at 00:00, so its windows are 00:00–15:00 and 30:00–45:00. A separate payload loss at 02:00 has windows 02:00–17:00 and 32:00–47:00. DNS recovery at 10:00 may restore lookups even while payload remains blocked. Payload recovery may independently restore known-address connections. Neither event renews the other role’s budget.
These are constructed operating examples. They are not measured Linux timings. Check failures, expired evidence, failed publication or unknown controls can close the relevant class earlier than an outer repair deadline.
Return, restart and withdraw
Recover the same provider through VPN 1 and the same payload role through VPN 2. Preserve both identities through restart; an operator reset can target one role without resetting the other.
An explicit operator recovery restart or host boot may replenish the affected allowance once while preserving provider selection and manual holds. Automatic crash/reconnect loops retain counters. Revalidate each class before reopening; restoring a saved provider is not restoring a saved health result. Follow the restart procedure and withdrawal sequence. Close and verify the owned gates before removing owned policy; never fall through to an unapproved route during rollback.
Check the boundary before acceptance
Fail each role separately and inspect both classes. VPN 2 must not become DNS fallback; VPN 1 must not become payload fallback. A broad process stop or whole-host firewall flush is not acceptable isolation.
Apply the shared IPv4 failure and acceptance procedure, including existing connections, application-context lookups, stale events, crash/boot resets and expired permissions. Record actual route/packet evidence and state transitions separately. These checks remain unexecuted on Linux.