iproute2 and libbpf: vendoring on the small scale
iproute2 and libbpf: vendoring on the small scale
Posted Nov 16, 2020 18:55 UTC (Mon) by dancol (guest, #142293)In reply to: iproute2 and libbpf: vendoring on the small scale by mkubecek
Parent article: iproute2 and libbpf: vendoring on the small scale
It's also worth looking at the status output of both commands in detail and see why people might prefer "ifconfig" to "ip". In particular: compare this "ip" output:
2: wlp59s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 04:ed:33:4c:b4:4a brd ff:ff:ff:ff:ff:ff
inet 192.168.86.185/24 brd 192.168.86.255 scope global dynamic noprefixroute wlp59s0
valid_lft 71064sec preferred_lft 71064sec
inet6 2604:4080:1321:8090:308c:1c2:a8b0:a941/64 scope global dynamic noprefixroute
valid_lft 3075sec preferred_lft 1275sec
inet6 fe80::ddec:2fe4:a8b6:842f/64 scope link noprefixroute
valid_lft forever preferred_lft forever
RX: bytes packets errors dropped overrun mcast
3125287182 3018779 0 246 0 0
TX: bytes packets errors dropped carrier collsns
403122417 957242 0 0 0 0
to this "ifconfig" output:
wlp59s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.86.185 netmask 255.255.255.0 broadcast 192.168.86.255
inet6 fe80::ddec:2fe4:a8b6:842f prefixlen 64 scopeid 0x20<link>
inet6 2604:4080:1321:8090:308c:1c2:a8b0:a941 prefixlen 64 scopeid 0x0<global>
ether 04:ed:33:4c:b4:4a txqueuelen 1000 (Ethernet)
RX packets 3018891 bytes 3125321368 (3.1 GB)
RX errors 0 dropped 246 overruns 0 frame 0
TX packets 957317 bytes 403128107 (403.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Both outputs are a bit noisy, but the "ifconfig" one is less so and prettier. Why does "ip" output a numeric prefix before each interface ("2:" above) instead of just the interface name? Why do the statistics for "ip" have to be in the form of a table ("RX:", "TX:") instead of a simpler "ifconfig"-style one-statistic-per-line approach? The "valid_lft 3075sec preferred_lft 1275sec" bit is pure noise for most people.
And why can't "ip" wrap lines at some reasonable length?
"ifconfig" persists when "ip" exists not only because people are irrationally stubborn, but also because "ifconfig" output produces output that makes the eyes bleed less than "ip"'s output. The brain is an association machine. If typing "ip" is followed by displeasure, for whatever reason and typing "ifconfig" is not followed by similar displeasure, then people are going to type "ifconfig" regardless of the theoretical advantages of typing "ip".
A few minor human-centered tweaks to "ip"'s interface would go a long way towards making people prefer it to "ifconfig".