I'd like to use more of the iproute2
(ip
command) utility instead of the deprecated net-tools
(ifconfig
, route
, ...).
The main reason I keep going back to net-tools
is the output of ip route
which in my humble opinion is lacking in clarity compared to the old route
that notably provides column titles:
ip route:
default via 192.168.134.254 dev enp1s0 proto static metric 100 10.42.0.0/24 dev wlp2s0 proto kernel scope link src 10.42.0.1 metric 600 10.56.30.0/24 dev enx00133b0402c2 proto kernel scope link src 10.56.30.143 169.254.0.0/16 dev wlp2s0 scope link metric 1000 192.168.57.0/24 dev vboxnet1 proto kernel scope link src 192.168.57.1 linkdown 192.168.134.0/24 dev enp1s0 proto kernel scope link src 192.168.134.142 metric 100
route:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.134.254 0.0.0.0 UG 100 0 0 enp1s0 10.42.0.0 * 255.255.255.0 U 600 0 0 wlp2s0 10.56.30.0 * 255.255.255.0 U 0 0 0 enx00133b0402c2 link-local * 255.255.0.0 U 1000 0 0 wlp2s0 192.168.57.0 * 255.255.255.0 U 0 0 0 vboxnet1 192.168.134.0 * 255.255.255.0 U 100 0 0 enp1s0
Question: Is there a way to have a clear/pretty display of the routes using the ip
command?
ip route | column -t
makes it a bit more pretty, but titles are still missing.ip
command output was designed that way to allow easier parsing.ip -j -d route show table all
, and then pretty print it in the format you like with your favourite programming language.