How Do You Diagnose VPN Routing with the Linux ip Route Command?
Instead of reading the whole routing table, ask the kernel one question at a time. Learn to read ip route get output and run a short, safe diagnostic session on a Linux machine with a VPN.
10 min readUpdated Nov 11, 2026By XPASS Editorial Team

When a VPN is connected on a Linux computer and a website still loads slowly, a local device disappears, or a page never opens, the instinct is to read the whole routing table and hope the problem jumps out. That works on a tiny setup. On a laptop with Wi-Fi, a tunnel interface, a container bridge and perhaps a second VPN, the table has many lines, and the line that matters is rarely the one you read first.
A better habit is to stop reading and start asking. The ip route get command takes a single destination, runs the same lookup the kernel runs for a real packet, and prints the decision. This article is a diagnostic guide built around that command. It does not repeat the theory of tables and longest-prefix match, which is covered in Linux VPN routing tables explained. Here the goal is practical: a short session you can run in a few minutes, a way to read every field of the output, and a sense of what the command cannot tell you.
Ask the kernel one question at a time
The routing table is a rulebook, but a rulebook is not a decision. A decision happens per packet: given this destination, this source and these marks, which interface and which next hop? The command ip route get 93.184.216.34 asks exactly that, using an example public address. The answer is a single line, which is far easier to compare with your expectations than thirty lines of table.
The strength of this approach is that it includes everything the kernel considers. Plain ip route show prints only the main IPv4 table. The real lookup also walks the policy rules shown by ip rule show, which may send a packet to an entirely different table first. Many modern VPN setups rely on those rules, so reading only the main table can make a broken setup look innocent and a working one look strange.
A second strength is that the command is read-only. It does not send a packet, change a route or touch the tunnel. You can run it on a machine that other people are using without risk, which makes it a good first step before any edit. It is worth saying once, clearly, that it shows what the kernel would do, not whether anything on the other side answers.

Reading the output field by field
Run the command for an ordinary public site while the VPN is connected and you will see something like this. The addresses are documentation examples.
$ ip route get 93.184.216.34
93.184.216.34 dev tun0 table 51820 src 10.8.0.2 uid 1000
cache
Each part answers a different question.
- dev tun0 is the interface the packet will leave through. This is the field you check first. If you expect the tunnel and see your Wi-Fi interface, the traffic is not protected by it. If you expect your Wi-Fi and see the tunnel, a route is capturing more than you intended.
- via appears when the packet goes to a gateway instead of directly onto the wire. A line with
via 192.168.1.1 dev wlp3s0means it goes to your router. A tunnel interface often has noviaat all, because there is only one place to send things. - src is the source address the kernel will put on the packet. Over the tunnel it is the tunnel's own address. On the physical link it is your local address. Seeing the wrong source address is a clue that the application is bound to a specific address or that the lookup took an unexpected route.
- table appears when the answer came from a table other than main. In the example, table 51820 tells you a policy rule redirected the lookup. That is normal for many setups, and it is the reason this command beats
ip route show. - uid shows which user the lookup was done for. Some policy rules are based on the user, so this occasionally matters.
- mark appears if you asked the kernel to treat the packet as marked, which you will see later.
If the output says RTNETLINK answers: Network is unreachable, the kernel has no route at all for that destination. That is a different problem from a wrong route, and it often means a family is missing, for example an IPv6 destination with no IPv6 default route.
A short diagnostic session in five steps
Use the same order each time so the results are comparable. Keep a note of every output; you will want to compare it with a run taken with the VPN off.
- Baseline with the VPN off. Run
ip route get 1.1.1.1andip route get 192.168.1.10, using any public address and any device on your own network. Write down the interface and source address for both. This is what a healthy machine does without the tunnel. - Connect the VPN and repeat. Run the same two commands. For a full-tunnel setup the public address should now name the tunnel interface, and the local device should still name your physical interface. If the local device now names the tunnel, a broad route has swallowed your network. The classic result is a printer that vanishes, described in why a local printer disappears when a VPN is on.
- Check the server itself. Find the address of the VPN server from the client's status output or configuration, then run
ip route get SERVER_ADDRESS. The answer should name the physical interface, or be marked in a way the rules recognise. If it names the tunnel, the encrypted packets would try to travel inside the tunnel and the connection will collapse. The symptoms and causes of this loop are covered in how to identify a VPN routing loop. - Check the failing destination. Resolve the name of the site that fails, using
getent hosts example.com, then runip route getfor each address returned. Compare with a site that works. A difference in interface or table is your lead. - Check the other family. Repeat with an IPv6 destination, for instance
ip -6 route get 2606:4700:4700::1111. A healthy IPv4 tunnel and an IPv6 path that still leaves through your ordinary connection is one of the most common surprises, and the plain IPv4 test will never show it.
At the end you should know which of three situations you are in: the route is right and the problem lies elsewhere, the route is wrong for one destination, or the route is wrong for a whole family or range.
Testing policy routing with from and mark
Policy routing makes the answer depend on more than the destination. Two options let you ask the question the way the kernel really sees it.
The from option sets the source address. If you have both a tunnel address and a physical address, ip route get 93.184.216.34 from 192.168.1.42 tells you what happens to a packet bound to the physical address, which matters for software that binds to a particular interface. Compare it with the same command using the tunnel address.
The mark option sets a firewall mark. Many tunnel setups mark their own encrypted packets so that a rule sends them to the main table instead of into the tunnel. If a mark is used on your machine, ip rule show will contain a line such as not from all fwmark 0xca6c lookup 51820. You can test both sides of that rule:
$ ip route get 203.0.113.10
203.0.113.10 dev tun0 table 51820 src 10.8.0.2 uid 1000
$ ip route get 203.0.113.10 mark 0xca6c
203.0.113.10 via 192.168.1.1 dev wlp3s0 src 192.168.1.42 uid 1000
The first answer shows what an ordinary application would get. The second shows what the marked, encrypted packet gets. If the second answer also names the tunnel, the exception that keeps the server outside the tunnel is not working. The number 0xca6c is only an example from a common WireGuard-style setup. Read the real mark from your own ip rule show output rather than copying it.
If you have no idea which software created a rule, do not delete it on a guess. The priority numbers and the table numbers are usually enough to find the owner, and removing a rule belonging to a running tunnel will simply break that tunnel.
Checking that the kernel's answer matches reality
The decision is only half the story. ip route get can say the packet leaves through the tunnel and the packet can still go nowhere. Three quick checks close the gap.
Interface counters. Run ip -s link show tun0 before and after loading a page. The transmit and receive packet counts should increase. If the transmit count rises and the receive count stays flat, packets leave but nothing comes back, which points at the far side, a firewall, or a return-path filter on your machine. If neither moves, the traffic is not entering the tunnel at all and your route lookup was not the one the application used.
The path itself. A tool such as traceroute or tracepath toward the failing destination shows the first hops. The first hop should be inside the tunnel's range if the route is correct. Treat later hops with caution; many networks do not answer these probes, so a silent hop is not a fault.
The return path. Reverse-path filtering can drop replies that come back on a different interface from the one the route points to. You can read the setting with sysctl net.ipv4.conf.all.rp_filter. A strict value combined with two default routes can drop legitimate traffic. The article on multiple default routes explains how that situation arises and how to reason about it.
Finally, remember that a name has to be turned into an address before routing begins. If a site fails by name and succeeds by address, the problem is DNS, not routing, and ip route get is the wrong tool for it.
A worked example: tunnel up, one site fails
Suppose you work from a Linux laptop, the VPN shows as connected, most sites load, but one internal tool at the address 10.50.4.20 never opens.
First, ip route get 1.1.1.1 names tun0, as expected for a full tunnel. Second, ip route get 10.50.4.20 also names tun0 with a source of 10.8.0.2. That looks fine, but the tool is on a network reached through your home router, not through the tunnel. The reason is that your home network and the tool's network share the same private range, a problem described in RFC 1918 style address planning.
Third, you run ip route get 10.50.4.1, an address you know belongs to your own home router. It names wlp3s0, which proves that a more specific home route exists for part of that range. The tool at 10.50.4.20 falls into a gap where the tunnel's broad route wins.
The fix does not belong in the routing table by hand. The cleanest answer is to change the home router to a different private range so the two networks no longer overlap, or to ask the network owner for a configuration that excludes your home range. As a temporary test you may add a single route with ip route add 10.50.4.20/32 dev tun0, run ip route get again, and confirm the change before deciding what to make permanent. Notes on keeping such changes safe are in the longer routing article.
This example has no mystery in it, and that is the point. Four short commands turned a vague symptom into a specific cause: an address range that exists on two networks.

What each result usually means
The table below summarises the patterns that come up most often. Treat it as a starting point; a result is a clue, not a verdict.
| What you see | Usually means | Next step |
|---|---|---|
| Public address names the physical interface with VPN on | Tunnel routes missing or lower priority | Check ip rule show and the VPN status |
| Local device names the tunnel | Broad route captured your LAN | Look for an overlapping or too-wide route |
| Server address names the tunnel | Server not excluded from the tunnel | Check the mark rule or host route |
| Network is unreachable | No route for that address family | Check the IPv6 table and default routes |
| Table number appears in the output | A policy rule redirected the lookup | Read ip rule show and that table |
| Correct interface but counters stay flat | Application used another path | Check bindings, containers, DNS |
| Correct interface, replies never arrive | Far side, firewall or return-path filtering | Check rp_filter and counters |
Limits and things to watch for
The command is valuable, but it has clear boundaries, and knowing them prevents wrong conclusions.
- It reports a decision, not delivery. A correct-looking line says nothing about whether the VPN server, the next hop or the destination answers.
- It reflects now. Routes can change when Wi-Fi reconnects, when the VPN reconnects, or when a network manager rewrites its settings. Run the command again after any such event.
- Containers and namespaces have their own tables. A command run on the host does not describe the routing inside a container or a network namespace. Run it inside the namespace you care about.
- Applications can bind to an interface. Some programs choose a source address or interface themselves, and will not follow the answer for a generic lookup. The
fromoption helps, but you should still confirm with counters. - It does not explain DNS. If names resolve through a resolver outside the tunnel, routing can be perfect and queries can still travel the wrong way.
- It does not measure safety. A route into the tunnel is one part of a protected connection. A VPN does not make you anonymous or guarantee security, and a correct routing table is not a test of either.
- Be careful with edits. Adding or deleting routes on a remote machine can cut your own connection. Save the current output first, keep a second session open, and change one thing at a time.
If you use the free VPNclient app from our supplier, the Linux notes in the setup guide cover the install requirements: a 64-bit Intel or AMD desktop with systemd. Use the commands in this article to observe what any VPN does to your routes, and make lasting changes through the VPN or network settings rather than by hand, because manual routes are not guaranteed to survive a reconnect.
Summary
The ip route get command turns a long routing table into a single answer. Run it for a public address, a local device, the VPN server and the failing destination, with the VPN off and then on, and repeat for IPv6. Read the interface, source, table and mark fields, confirm the result with interface counters, and remember that it reports a decision, not delivery. Used in this order it finds most misrouted traffic in a few minutes.
If you want a ready-to-use VPN for a Linux desktop, the Linux setup guide shows the install steps for VPNclient, and the pricing page lists the prepaid passes when you are ready.
Frequently asked questions
What does ip route get actually tell me?
It asks the kernel which route, interface, gateway and source address it would use for one destination right now. Because it runs the real lookup, it includes policy rules and extra tables that a plain ip route show does not display.
Why does ip route show look fine while traffic still goes the wrong way?
Plain ip route show prints only the main table. Policy rules from ip rule can send traffic to another table first, and IPv6 has its own table, so the main IPv4 table alone can hide the real decision.
Does ip route get send any packets?
No. It only performs the lookup and prints the result, so it is safe to run on a machine in use. It shows what the kernel would do, not whether the next hop actually answers.
How do I test the path of the VPN's own encrypted packets?
Run ip route get for the server address. If the answer names the tunnel interface instead of your physical network, the encrypted packets would loop into the tunnel they belong to. Some setups mark those packets, so you can also try the mark option.
Can this command fix a routing problem?
No. It only diagnoses. Changes are made with ip route add or del, or better in the VPN or network configuration, and should be tested one at a time with a second way into the machine kept open.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need a VPN for a short trip or a busy month?
XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.
See passesKeep reading

Device Guides
Linux VPN Routing Tables Explained
A VPN on Linux is mostly a set of routing decisions. Learn to read ip route, understand the half-default trick and policy tables, and diagnose why traffic goes the wrong way.
9 min read

Troubleshooting
How Can You Identify a Routing Loop After Connecting a VPN?
A routing loop sends packets round in circles until they expire. Here is how to recognise one after you connect a VPN, confirm it with simple tools, and work out where it starts.
11 min read

Troubleshooting
How Do Multiple Default Routes Cause VPN Connection Problems?
When Wi-Fi, Ethernet, a hotspot and a VPN each claim to be the way to the internet, traffic can take the wrong path. Here is how to read your routes and untangle the clash.
11 min read