On Tue, Aug 15, 2017 at 03:03:35PM +0200, Dejan Jocic wrote:
> And what exactly do you miss in ifconfig and net-tools package, that you
> can not do with ip, which is part of iproute2 package that comes as part
> of base system?

What iproute2 and net-tools are BOTH missing is a sane, script-friendly,
user-controllable output format.

What iproute2 is specifically missing (as far as I can determine):
consistent option syntax, and any report analogous to "netstat -in":

wooledg:~$ netstat -in
Kernel Interface table
Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0      1500  8254258      0      0 0       7682795      0      0      0 BMRU
lo       65536   579959      0      0 0        579959      0      0      0 LRU

In a world where virtually every possible output of every reporting
command is atrociously hard to read, that one is the least bad.  You can
actually get the interface names with only two reasonably simple parsing
operations (strip the first line, then strip everything from the first
whitespace to EOL).

The closest analog I've found in iproute2 is "ip link", which looks like:

wooledg:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode 
DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000
    link/ether a0:8c:fd:c3:89:e0 brd ff:ff:ff:ff:ff:ff

Parsing the interface names out of THAT is significantly harder.

The real tragedy is the missed opportunity.  Linux developers wrote
iproute2 from scratch, but they failed to add any kind of user-specified
output format (cf. ps h -o ppid, find -printf %h, etc.), or to sit down
and THINK about how the user interface should be designed.  Instead of
a clean, friendly, consistent, useful new tool we just got this weird
monstrosity that feels like someone decided to change things just because
they were bored one day, without any rhyme or reason or plan.

Reply via email to