Routing policy, VPN operation, and availability monitoring have different jobs. This introduction explains the tools before you choose one of the six configurations. The walkthroughs remain untested on Linux.
How to Use This Series
There are three levels to this material. Start with the tools and what they do, then choose a configuration that fits your needs.
- Understand the tools. This introduction explains routing, firewall rules, DNS selection, and their Linux and Ubuntu context.
- Build a basic configuration. Choose a scenario from the VPN/DNS decision table. Each basic walkthrough links to the shared application-routing foundation and contains the prerequisites, commands, explanations, and checks needed for that one policy.
- Add advanced behavior later. Automatic provider switching, event handlers, and availability loops belong in later tutorials. They remain separate from these basic configurations.
All six basic walkthroughs now combine their explanations and technical steps. Their source and local page checks are complete, but Linux validation remains pending; advanced automation is deferred.
Which Tools Are We Using?
Before getting into the examples, it helps to sort out the names. You will see iproute, iproute2, Netfilter, iptables, and ipchains in discussions about Linux networking. Some are alternatives from different generations. Others are parts of the same system, with different jobs.
These guides use iproute2 to configure routing and iptables/ip6tables to configure the firewall rules supported by Netfilter.
On a narrow screen, scroll the table sideways to read all three columns.
| Name | What It Is | How We Use It |
|---|---|---|
| iproute2 | The networking toolset that includes the ip command. |
Configure and inspect interfaces, routes, routing tables, and policy rules. |
| iproute | A name you may encounter for the package containing iproute2. The package name depends on the distribution. | Recognize the package name; it is not an additional routing tool to combine with iproute2. |
| Netfilter | The framework inside the Linux kernel that supports packet filtering and related processing. | The underlying machinery used by the firewall configuration; there is no separate netfilter command in these examples. |
| iptables | The command-line tool for configuring IPv4 packet filtering, marking, and address translation. The package also provides ip6tables for IPv6. | Restrict permitted paths, mark selected traffic, and apply address translation where the topology requires it. |
| ipchains | The older firewall tool superseded by iptables. Its syntax and packet-processing behavior differ. | Historical context only; it is not used in these configurations. |
For example, Fedora calls its package iproute, but identifies iproute2 as its upstream project. The name alone does not mean you have an older, separate version of the routing tools. Netfilter’s project overview, iptables documentation, and comparison with ipchains explain the firewall relationships.
In the examples, ip route defines the available paths, while ip rule determines which routing table applies to particular traffic. iptables and ip6tables apply the packet restrictions. A firewall chain is a list of rules; that term does not mean the older ipchains program. The ip command
Where the Linux Kernel Fits
The commands you type run outside the kernel. The kernel handles the packets using the configuration those commands provide. This distinction matters when reading an older article: a familiar command name does not guarantee that a particular option exists on an older system.
On a narrow screen, scroll the table sideways to compare the generations.
| Tool or Facility | Kernel Context | Meaning for These Guides |
|---|---|---|
| ipchains | The Linux 2.2 generation of packet filtering. | Historical background. Do not translate these examples into ipchains commands. |
| Netfilter and iptables | The Linux 2.4 generation introduced the framework and firewall interface used by these examples. | The starting point for understanding the firewall model, not a claim that every current extension works on Linux 2.4. |
| iproute2 | Uses the kernel’s routing interface, rtnetlink, which dates to Linux 2.2. | Configure current routing with ip; check support for the particular feature being used. |
| nftables | Entered mainline Linux in 3.13. | Relevant because a modern iptables command may use the nftables backend. Native nft walkthroughs are outside this series’ current scope. |
These are historical milestones, not a supported-platform list. See the Netfilter history, rtnetlink version history, and Ubuntu firewall overview.
There is no single kernel version that establishes compatibility for everything in the series. The installed tools, enabled kernel facilities, resolver, and particular commands all matter. Each walkthrough states its prerequisites; Ubuntu 24.04 is the proposed lab platform, not a tested-platform claim.
Ubuntu and Kernel Versions
Ubuntu is the distribution used as the reference point here. The table shows the original general-availability (GA) kernel series for selected Ubuntu LTS releases. It helps place an older article in context; it is not a recommendation to install an older release.
| Ubuntu LTS Release | Original GA Kernel Series |
|---|---|
| 14.04 | 3.13 |
| 16.04 | 4.4 |
| 18.04 | 4.15 |
| 20.04 | 5.4 |
| 22.04 | 5.15 |
| 24.04 | 6.8 |
| 26.04 | 7.0 |
Sources: Ubuntu kernel lifecycle, Canonical’s kernel reference, and Ubuntu 26.04 release notes. Release mappings rechecked November 26, 2026.
An Ubuntu release can run a newer kernel through its hardware-enablement (HWE) stack. For example, Ubuntu 22.04’s GA kernel is 5.15, while its 22.04.5 HWE kernel is 6.8. OEM, cloud, and custom kernels can also differ. Consequently, the release name alone does not tell you which kernel is running. Ubuntu kernel reference
Check Your Own System
Record the Ubuntu release, running kernel, and installed command versions before applying a walkthrough:
cat /etc/os-release
uname -r
ip -V
iptables --version
ip6tables --version
These commands inspect the system; they do not change its configuration. uname -r reports the kernel currently running. ip -V reports the installed iproute2 version. If a command is missing, its tools must be installed before a walkthrough using it can be followed.
The iptables version output also identifies its backend, such as nf_tables or legacy. Ubuntu has used the nftables backend by default since 20.10, while retaining the iptables command interface. That does not require rewriting these examples as nft commands, but it does mean that testing should record the backend. Ubuntu’s backend explanation
Use one consistent firewall backend for an exercise. Do not switch backends or combine a second firewall manager’s rules simply to make an example match. The basic guides need to state which existing configuration they assume.
What About the DNS Resolver?
The resolver configuration chooses which DNS server receives a request. Routing selects the path to that address, and the firewall restricts which destinations and paths are permitted. The examples show the resolver settings needed to make those choices work together.
The packet checks in these guides verify the routing and firewall configuration. They do not establish that a DNS provider is trustworthy or continuously available. Availability assessment remains a separate subject, rather than another requirement to build into these basic examples.
Three Types of Guides
These are three separate technical responsibilities. They are distinct from the learning sequence above: introductory teaching, basic how-tos, and later advanced tutorials. Keeping a basic routing example short does not require combining it with VPN operation or monitoring.
On a narrow screen, scroll the table sideways to compare the responsibilities.
| Guide Type | Responsibility | Tools and Inputs |
|---|---|---|
| Routing and DNS policy | Select the provider, route packets, restrict alternatives, and define the result when a route becomes unavailable | iproute2, Netfilter through iptables/ip6tables, and the existing resolver |
| VPN operation | Create, authenticate, maintain, reconnect, and remove the VPN connection; expose its interface and state | The chosen VPN client and its connection manager |
| Availability monitoring | Determine whether a selected path or DNS service responds, and report the result | Explicit DNS requests, packet captures, and any separately designed observer |
Start with the routing decision table. Read VPN Operation and the Routing Interface, Checking DNS Availability and the OpenVPN/NetworkManager observation guide for those separate responsibilities. They provide source-reviewed diagnostics. The separate advanced Ubuntu walkthrough connects the OpenVPN-specific automatic controls to their local controller, installation and persistence source. It does not add automatic switching to these simple routing examples. Linux runtime validation remains deferred.
What the Routing Guide Requires
The routing examples start with an existing direct connection and the required VPN interfaces. Record each interface name, local address, any required next hop, return path, and the owner of its configuration. Prepare the Application Routing Foundation first, keeping the account, table, mark and firewall prerequisites specified by the individual example.
Names such as tun0, tun1, and eth0 describe the example topology. They do not require OpenVPN. Substitute the actual names consistently. The illustrated dev routes assume the stated tunnel topology; a transport that needs a next-hop gateway or additional peer configuration must supply that before these examples are applicable. A name change alone does not establish compatibility.
The resolver choice is also explicit. Some examples use a private resolver environment; others use an existing systemd-resolved stub. These are resolver prerequisites, independent of the VPN client.
Work with the State Linux Knows
Linux selects from the routes eligible under its current routing rules and interface state. iproute2 configures and inspects that state. When a preferred route is withdrawn or excluded, the remaining policy determines whether traffic uses another permitted path or stops.
For equal destination prefixes in one table, metrics can express preference. An unreachable route ends lookup with an error; blackhole discards traffic. Neither means “try the next policy table.” A missing route, or a throw route, can allow policy lookup to continue to a later rule. Route types and metrics, Rule ordering
Link-down handling must be explicit. Linux 4.2 introduced the IPv4 setting ignore_routes_with_linkdown. When enabled, it excludes routes whose link is marked down from route selection. The setting is disabled by default; it does not check whether a remote VPN endpoint or DNS server is responding. Linux 4.2 source, Kernel link-down handling
Inspect the effective setting on the test host; do not assume every installed route is automatically excluded on link loss. The routing exercises use deliberate removal of an owned preferred route as a reproducible test, leaving terminal routes and firewall guards installed.
No availability loop is needed for the kernel to act on a routing-state change it already knows. A route that remains eligible despite a stalled transport is a different case, covered by the operation and monitoring guides. It does not change the configured privacy policy.
Silo DNS Under the Selected Policy
Follow the packet from the application to its resolver, then from the resolver to the upstream provider. When a shared resolver creates the upstream packet, the requesting application’s account and packet mark do not automatically transfer to it. Select the resolver’s path deliberately, then verify its destination, output interface, source, and return path.
The strict examples retain a terminal route and an independent firewall restriction. The direct-only example uses the same approach to prevent DNS from moving into a VPN. The two-VPN examples give DNS and application packets separate permitted paths.
Route Fallback and Provider Switching
Routes select paths to destination addresses. An alternative route to one DNS address does not substitute a different provider’s address. Resolver selection makes that second decision. Resolver settings
Example 2B therefore defines direct, VPN, and closed firewall modes with explicit resolver changes. It is a walkthrough of allowed policy transitions, not an automatic provider-switching controller. Kernel route selection can react to known route loss without polling, but these different-provider transitions still need an operator or a separately reviewed integration to request the mode change.
Verify Each Responsibility Separately
Keep route lookup, route removal/restoration, firewall counters, and packet-path acceptance tests in the routing guides. A few diagnostic DNS requests verify that the configured policy is used; they are not a background availability monitor.
Test VPN startup and reconnect behavior in the operation guide. Test an unresponsive service and any detection thresholds in the monitoring guide. Combined acceptance testing should confirm the three work together, while recording which responsibility each test exercises. None of these layers has been runtime-certified in this Windows workspace.
Review History
Preserved pre-review draft (text). Technical source review and local page validation were completed November 26, 2026. These simple examples retain explicit manual route/provider selection. The separate advanced Ubuntu walkthrough covers automatic controls, persistence, installation and rollback using the completed local reference source. Linux runtime validation remains deferred.