Resolve the kernel route to an address
Build a paste-ready command, then review its compatibility and effects before running it.
ip route get <address>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementsipip must be installed and available on PATH.
Version supportip Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals192.0.2.10 via 192.0.2.1 dev eth0 src 192.0.2.20 uid 1000Representative successful output; values vary with the selected target and system state.
Known errorsip: command not foundip is missing or is not available on PATH.
Verifyip route get {{address}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01ipCommandRuns the ip stage of this one-liner.
02routeArgumentPasses route to ip.
03getArgumentPasses get to ip.
04<address>ParameterA value supplied in the Fill parameters section.
Example input
ip route get 192.0.2.10
Example output
192.0.2.10 via 192.0.2.1 dev eth0 src 192.0.2.20 uid 1000
cache
Illustrative output — exact values vary by system and data.
Official sources