2024-10-31 11:38:15 -07:00
|
|
|
# ip route get
|
|
|
|
|
|
|
|
> Get a single route to a destination and print its contents exactly as the kernel sees it.
|
|
|
|
> More information: <https://manned.org/ip-route>.
|
|
|
|
|
|
|
|
- Print route to a destination:
|
|
|
|
|
2025-03-09 14:01:49 +02:00
|
|
|
`ip {{[r|route]}} {{[g|get]}} {{1.1.1.1}}`
|
2024-10-31 11:38:15 -07:00
|
|
|
|
|
|
|
- Print route to a destination from a specific source address:
|
|
|
|
|
2025-03-09 14:01:49 +02:00
|
|
|
`ip {{[r|route]}} {{[g|get]}} {{destination}} from {{source}}`
|
2024-10-31 11:38:15 -07:00
|
|
|
|
|
|
|
- Print route to a destination for packets arriving on a specific interface:
|
|
|
|
|
2025-03-09 14:01:49 +02:00
|
|
|
`ip {{[r|route]}} {{[g|get]}} {{destination}} iif {{eth0}}`
|
2024-10-31 11:38:15 -07:00
|
|
|
|
|
|
|
- Print route to a destination, forcing output through a specific interface:
|
|
|
|
|
2025-03-09 14:01:49 +02:00
|
|
|
`ip {{[r|route]}} {{[g|get]}} {{destination}} oif {{eth1}}`
|
2024-10-31 11:38:15 -07:00
|
|
|
|
|
|
|
- Print route to a destination with a specified Type of Service (ToS):
|
|
|
|
|
2025-03-09 14:01:49 +02:00
|
|
|
`ip {{[r|route]}} {{[g|get]}} {{destination}} tos {{0x10}}`
|
2024-10-31 11:38:15 -07:00
|
|
|
|
|
|
|
- Print route to a destination using a specific VRF (Virtual Routing and Forwarding) instance:
|
|
|
|
|
2025-03-09 14:01:49 +02:00
|
|
|
`ip {{[r|route]}} {{[g|get]}} {{destination}} vrf {{myvrf}}`
|