Stop wasting time guessing which interface your traffic is actually leaving on
Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Stop wasting time guessing which interface your traffic is actually leaving on
🧩 The Challenge
You are sitting there staring at a packet capture thinking your server is talking to the database over the private VLAN, but it turns out the kernel is routing it through the public interface. I’ve spent whole afternoons debugging connection timeouts only to realize the source IP being used was completely wrong.
💡 The Fix
Use the ip route get command to have the kernel calculate the path for a specific destination without sending a single packet out onto the wire.
ip route get 10.0.42.5
⚙️ Why It Works
This query forces the kernel to perform its lookup process as if it were sending real traffic, showing you the exact source IP, the egress interface, and the gateway it picked for the job.
🚀 Pro-Tip: Stick a specific source address with -s to see how the routing table changes when you force traffic through a secondary NIC.
Linux Tips & Tricks | © ngelinux.com | 8/20/2026
