Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Linux Commands / IT Support Guides

Check Linux route selection with ip route get

Check which interface and gateway Linux would use to reach one IP address.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution

Understand the problem

Use the affected machine or container. Replace the documentation address 192.0.2.10 with the destination you actually need to reach.

Run the command

Run ip route show to inspect the main routing table, then run ip route get with the destination IP. The second command performs a local route lookup.

ip route show
ip route get 192.0.2.10

Read the output

In a result such as 192.0.2.10 via 192.0.2.1 dev eth0 src 192.0.2.25, via is the gateway, dev is the outgoing interface and src is the selected local source address. Some routes are direct and omit via.

Choose the next step

Compare the selected interface and source address with what you expect. If Linux reports that the network is unreachable, check the interface address and routing configuration.

Before making changes

A route lookup shows the local routing decision. Confirm reachability separately before changing a gateway or routing rule.

Source & further reading

Linux manual — ip-route

Independently written summary reviewed on 2026-11-01. The example illustrates a possible application; it is not a client case study.

Share this article

Back to all articles