Advanced IPv4 controls · Simple VPN and DNS policies
Reach a designated independent DNS provider through VPN 1 while selected payload uses VPN 2. The independent provider does not make direct DNS permissible.
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 | Independent resolver through VPN 1 |
| Other application and host-service DNS | Same independent 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
-
Create distinct DNS-VPN-1 and payload-VPN-2 ownership records as in 4A. Choose the independent provider explicitly and record its allowed endpoint and expected control answers.
-
Route that provider through VPN 1 for every host resolver context. Reject implicit selection of VPN 1 native DNS, VPN 2 DNS or a direct route to the same public resolver address.
-
Keep separate provider-service and VPN-session evidence. A failing remote resolver does not prove VPN 1 is broken; restart only an implicated owned resource.
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 |
|---|---|
| Independent resolver fails; both VPNs work | Deny DNS only. Keep healthy VPN 2/direct payload by known address. |
| VPN 1 fails | Deny DNS using VPN 1. Preserve independently healthy VPN 2 payload. |
| VPN 2 fails | Deny selected payload only. Keep the independent resolver available through healthy VPN 1. |
| Provider answers directly but not through VPN 1 | Treat the required DNS path as failed. Direct reachability is not permission to bypass it. |
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
The independent resolver stops answering through VPN 1 at 00:00. The same public address might answer over the direct connection, but that observation does not qualify the required path. Keep DNS closed and known-address payload on VPN 2. Once the provider works through VPN 1 and the required checks pass, release DNS independently of any payload incident.
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
Restore the selected independent provider through VPN 1. The rest of the role-specific repair, reset and withdrawal procedure matches 4A; provider selection remains distinct.
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
Try the independent provider directly, VPN 1’s native resolver and any resolver through VPN 2. All are outside this DNS policy. Confirm that DNS-only loss leaves a healthy numeric payload connection through VPN 2 usable.
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.