December 2018
Beginner
826 pages
22h 54m
English
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 ...