ip route get
linux
Get a single route to a destination and print its contents exactly as the kernel sees it.
More info →Options (2)
booleanPrint route to a destination
Example:
ip {{[r|route]}} {{[g|get]}} {{1.1.1.1}}booleanPrint route to a destination
Example:
ip {{[r|route]}} {{[g|get]}} {{1.1.1.1}}Examples (6)
Print route to a destination
ip [r|route] [g|get] 1.1.1.1Print route to a destination from a specific source address
Print route to a destination for packets arriving on a specific interface
ip [r|route] [g|get] destination iif ethXPrint route to a destination, forcing output through a specific interface
ip [r|route] [g|get] destination oif ethXPrint route to a destination with a specified Type of Service (ToS)
ip [r|route] [g|get] destination tos 0x10Print route to a destination using a specific VRF (Virtual Routing and Forwarding) instance
ip [r|route] [g|get] destination vrf myvrfmade by @shridhargupta | data from tldr-pages