Live data from Hacker News

There are real reasons for Linux to replace ifconfig, netstat, etc

utcc.utoronto.ca

21–30 of 270 posts

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#21
post #18

I'm trying hard to fight my old muscle memory to use ip instead of ifconfig on Linux. I have a few issues though: * "ip" is useless as a keyword if you're looking for help online. It's extremely frustrating and probably my main issue actually learning how to use the damn thing. * ifconfig's output is simply more readable IMO: https://svkt.org/~simias/up/20180525-113825_ip-vs-ifconfig.p... . It's pretty weird that a b…

Exactly. Even the `ip` name is misleading as the command does much more than only ip-related things (link layer, network namespaces, tcp, …).

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#22
post #18

I'm trying hard to fight my old muscle memory to use ip instead of ifconfig on Linux. I have a few issues though: * "ip" is useless as a keyword if you're looking for help online. It's extremely frustrating and probably my main issue actually learning how to use the damn thing. * ifconfig's output is simply more readable IMO: https://svkt.org/~simias/up/20180525-113825_ip-vs-ifconfig.p... . It's pretty weird that a b…

> "ip" is useless as a keyword

Most docs will mention iproute2. You can use that for googling.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#23
post #15

Isn't the described mismatch between "reality" and what ifconfig reports once again a case of systemd (networkd) not exposing IP aliases in the traditional way, and replacing established network concepts by it's own stuff? Meant as a genuine question rather than trolling (though I know I'd hate to bow to whatever systemd comes up with rather than just using ifconfig which has worked since the begin of times) eg. ther…

No. The Linux kernel has two APIs, and has had since before systemd even existed. ifconfig uses the ioctl() API, which presents the concept of alias IP addresses in one way. ip uses the netlink API, which presents the concept of multiple IP addresses per interface in a different way. M. Siebenmann did include this point. * https://sourceforge.net/p/net-tools/bugs/12/ * https://bugs.debian.org/cgi-bin/bugreport.cgi?bu…

This begs the question of why the kernel doesn't allocate an alias for backwards compatibility when adding IP adresses through the netlink API.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#24

Why did they have to make the output of `ss` so cumbersome? I often end up installing the legacy tooling just so I can have `netstat`

I'm a fan of 'lsof -i', in fact of lsof for anything. Makes lots of sense to treat network sockets and files as equals: that's the big idea of UNIX.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#25
post #7

What's all the fuzz about this "sudden" change? iproute2 is part of linux (kernel) since 1999 or so.

Archlinux ships this as default now (and has for about a year) and I think Ubuntu is doing the same. Thus people are increasingly being exposed to iproute2.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#26
post #9
post #7

What's all the fuzz about this "sudden" change? iproute2 is part of linux (kernel) since 1999 or so.

It promptly got filed under "ah, learn that one day", then after coming up enough times got relegated to "ugh, stop bothering me about it, I'll get to it eventually" and everyone has been un-motivated-ly unimpressed about it ever since. I think.

FWIW I can usually never get ifconfig to do what I want it to, but with ip it's usually fairly straight-forward.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#27
post #18

I'm trying hard to fight my old muscle memory to use ip instead of ifconfig on Linux. I have a few issues though: * "ip" is useless as a keyword if you're looking for help online. It's extremely frustrating and probably my main issue actually learning how to use the damn thing. * ifconfig's output is simply more readable IMO: https://svkt.org/~simias/up/20180525-113825_ip-vs-ifconfig.p... . It's pretty weird that a b…

> ifconfig's output is simply more readable IMO

Yes, this is key, and why ip is so terrible for the way I currently work. No doubt I'll have to get used to it, like those stupid biosdevname interfaces.

90% of my machines don't have more than 1 IP per physical interface, the rest are aliases

ifconfig outputs clear whitespace, so picking out the specific details of

- interface name

- ip address

Is far easier. I do prefer /28 to 255.255.255.240 when specifying subnets, but it does make it far harder to scan what the IP is. I suspect the people writing the utilities are the ones who are able to automate everything, as they do the same job 1000 times, with IP in, IP out, and no concern about physical devices, so rarely use the tool to read data, certainly not as a human.

You've then got the "what's the default gateway" problem

route -n

shows it nice and easy

  Kernel IP routing table
  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  0.0.0.0         172.26.32.1     0.0.0.0         UG    0      0        0 eth0
  172.26.32.0     0.0.0.0         255.255.240.0   U     0      0        0 eth0
ip route -n returns

  ip route -n
  Command "-n" is unknown, try "ip route help".
Helpful, ip route help is no help at all

It's all good having tools to manage lots of ip namespaces etc, that's great in the subset of cases you need that functionality, but for those of us that manage physical machines with physical inputs/outputs, rather than datacenter scale devices, it's a right pain.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#28
post #19

Earlier quoted context omitted.

Learning how to read the help output is often enough I find the 'ip --help' is virtually incomprehensible, and the man page no better. There's no explanation about what the tool can do, only some machine-readable formatting of the syntax expected. This kind of documentation is useless IMO, it's actively hostile to new users.

The tool allows one to manipulate kernel objects more or less 1:1, so documentation and help of 'ip' and 'tc' is adequate enough if you know what those kernel objects are and how they behave, but it won't help if you don't know anything about linux networking or traffic shaping in the first place.

What's the best way to learn these things?

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#29
post #18

I'm trying hard to fight my old muscle memory to use ip instead of ifconfig on Linux. I have a few issues though: * "ip" is useless as a keyword if you're looking for help online. It's extremely frustrating and probably my main issue actually learning how to use the damn thing. * ifconfig's output is simply more readable IMO: https://svkt.org/~simias/up/20180525-113825_ip-vs-ifconfig.p... . It's pretty weird that a b…

The man page is good.

`ip` takes a --oneline arg to make it more parseable.

Re: There are real reasons for Linux to replace ifconfig, netstat, etc

#30

Why did they have to make the output of `ss` so cumbersome? I often end up installing the legacy tooling just so I can have `netstat`

It seems like a missed opportunity not to have a JSON (or other explicitly machine readable format) output option for easy scripting use through jq. Every time I need to craft a grep regex to get some trivial piece of information from one of these tools, I feel there's a bug waiting to happen (and I'm usually right).
Post reply on HN