Tracing network routes with ip
The ip
utility reports information about the state of your network. It can tell you how many packets are being sent and received, what types of packets are being sent, how the packets are being routed, and more.
Getting ready
The netstat
utility described in Chapter 8, The Old-Boy Network is standard in all Linux distributions; however, it is now being replaced by more efficient utilities, such as ip
. These new utilities are included in the iproute2
package, which is already installed on most modern distributions.
How to do it...
The ip
utility has many features. This recipe will discuss a few that are useful for tracing network behavior.
Reporting routes with ip route
When packets don't reach their destination (ping
or traceroute
fail), the first thing an experienced user checks is the cables. The next thing to check is the routing tables. If a system lacks a default gateway (0.0.0.0
), it will only find machines on its physical network. If you have multiple networks...