Show the default network route
Build a paste-ready command, then review its compatibility and effects before running it.
ip route show defaultread-onlyno known side effects Compatibility
LinuxUse route -n get default on macOS.
Operational knowledgereview due 2027-01-19
Requirementsipip must be installed and available on PATH.
Version supportip Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsdefault via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.42 metric 100Representative 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 show defaultThe 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.
03showArgumentPasses show to ip.
04defaultArgumentPasses default to ip.
Example input
ip route show default
Example output
default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.42 metric 100
Illustrative output — exact values vary by system and data.
Official sources