Q: A server has two network interfaces but traffic to a specific subnet is going out the wrong interface. How do you diagnose and fix the routing?
Linux maintains a routing table that determines which interface handles traffic to each destination.
#Linux #Linux / SRE — Scenario-Based Interview Questions #L2 #SRE #Systems #Troubleshooting
🎙️ Candidate Opening & Architectural Context
""Never reboot a server blindly; always capture top process telemetry, lsof descriptors, and thread dumps first. The interviewer is testing: Linux routing table, ip route, policy-based routing.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
Linux maintains a routing table that determines which interface handles traffic to each destination.
- View the routing table:
ip route showdisplays all routes, including default gateway and subnet-specific routes. - Check which route applies:
ip route get 10.20.30.40shows exactly which interface and gateway will be used for a specific destination. - Add a specific route:
2️⃣
Remediation & Permanent Safeguards
Diagnosis: Fix: This forces all traffic to 10.20.0.0/16 through eth1 via gateway 192.168.1.1. For complex multi-homed setups, Linux policy-based routing with ip rule allows routing decisions based on source IP, not just destination.
ip route add 10.20.0.0/16 via 192.168.1.1 dev eth1
- Delete the incorrect route:
- Persist the route: Add to
/etc/sysconfig/network-scripts/route-eth1(RHEL) or/etc/netplan/*.yaml(Ubuntu):
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: View the routing table: ip route show displays all routes, including default gateway and subnet-specific routes.."
⚡ 60-Second Elevator Pitch Talking Points
- View the routing table: ip route show displays all routes, including default gateway and subnet-s...
- Check which route applies: ip route get 10.20.30.40 shows exactly which interface and gateway wil...
- Add a specific route:
Advertisement