Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

Checking what route our box will take

It's also possible that connectivity might be failing because your box is trying to talk out of the wrong interface. We can check this with ip again.

First, let's look at which route we're going to take when communicating with the wider world.

In the following code, we're checking how our box would attempt to talk to the device with the IP 1.1.1.1. It shows us that we would go to this IP via the gateway address, 10.0.2.2, and our eth0 interface:

$ ip route get 1.1.1.11.1.1.1 via 10.0.2.2 dev eth0 src 10.0.2.15     cache 

Now, let's see what route we'll take if we're communicating with our gateway. Here, we can see a direct connection (no via) also going out of eth0:

$ ip route get 10.0.2.210.0.2.2 dev eth0 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content