← 返回命令列表

Linux command

ip-route-get 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Example

ip route get [1.1.1.1]

Example

ip route get [destination] from [source]

Example

ip route get [destination] iif [eth0]

Example

ip route get [destination] oif [eth0]

Example

ip route get [destination] tos [0x10]

Example

ip route get [destination] vrf [myvrf]

说明

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.

参数

from _SOURCE_
Source address for route lookup
iif _DEVICE_
Input interface (for forwarded packets)
oif _DEVICE_
Force output interface
tos _TOS_
Type of Service value
vrf _NAME_
VRF instance name
mark _MARK_
Firewall mark value

FAQ

What is the ip-route-get command used for?

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.

How do I run a basic ip-route-get example?

Run `ip route get [1.1.1.1]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does from _SOURCE_ do in ip-route-get?

Source address for route lookup