Missing ip command line tool on macOS The ip program is a multi-purpose network configuration tool that makes use of the full range networking features available in modern Linux kernels.  

However, it does not work on Mac:

$ ip a
;; connection timed out; no servers could be reached


Switch to Ubuntu,things go well

$ ip a
;; connection timed out; no servers could be reached

1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever inet6 ::1/128 scope host
    ...


Is there  a substitute tool for it?
This question was asked on Superuser.SE

The accepted solution is to use brew to install iproute2mac, which adds the ip command.