Linux ip route Error: RTNETLINK answers: File exists

Attempted to add a duplicate default gateway or overlapping subnet route.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Linux ip route Error Platform: Linux
Common Root Causes:
  • Attempted to add a duplicate default gateway or overlapping subnet route.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Use `ip route replace` instead of `ip route add` or remove the conflicting gateway.
Safe Diagnostic Command:
ip route show
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Attempted to add a duplicate default gateway or overlapping subnet route. Recommended diagnostic: `ip route show`. Remediation: Use `ip route replace` instead of `ip route add` or remove the conflicting gateway.

Worked Examples

  • Run `ip route show` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-linux-ip-route-rtnetlink-exists · Independently verified: 2026-11-25

Related Resources