ip-route-get
TLDR
Print route to destination
SYNOPSIS
ip route get destination [options]
DESCRIPTION
ip route get performs a route lookup and displays exactly which route the kernel would use for a given destination. This shows the complete route entry including gateway, interface, source address, and any other attributes.
Unlike ip route list, which shows stored routes, ip route get queries the kernel's routing decision for a specific packet, accounting for policy routing rules and route selection algorithms.
PARAMETERS
from SOURCE
Source address for route lookupiif DEVICE
Input interface (for forwarded packets)oif DEVICE
Force output interfacetos TOS
Type of Service valuevrf NAME
VRF instance namemark MARK
Firewall mark value
CAVEATS
The output reflects the current routing state, which may change dynamically. VRF lookups require the VRF to be configured. Mark-based lookups require matching policy rules.
HISTORY
ip route get is part of iproute2 and provides insight into the kernel's actual routing decisions, which can differ from the stored route table due to policy rules and route metrics.
SEE ALSO
ip(8), ip-route(8), ip-route-list(8), ip-rule(8)


