Live data from Hacker News

Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

blog.farhan.codes

71–80 of 141 posts

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#71
post #38
post #16

There's an assumption which this article makes which is not true; namely, that the only utilities which do (or should) use ioctl's are system programs like ipconfig which are shipped with the kernel. There are other programs, like for example Kerberos, who want to know what network addresses are used by the network, and requiring them to screen scrape ipconfig is not especially reasonable. So if you randomly change i…

It seems like for many userspace applications, the appropriate backwards compatibility ABI would have been at the SO level. ELF shlibs make it easy to version interfaces without breaking old dynamically linked programs. Linux is sort of the odd duck in that it considers the entire syscall surface a stable ABI. It leads to a lot of neat results, but can obviously also cause pain when some older interfaces are not suff…

I would argue that the stable syscall interfaces is one of the main drivers behind Linux success. Containers as we know them would be quite different if they needed to somehow merge the kernel version appropriate .so files into the fs. They would forever remain just sandboxes of the essentially the same distro as the host just like they are on Solaris/FreeBSD.

Also something like WSL would be impossible

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#72
post #17

Huh?!? I use multiple addresses a lot, and recall having used them through ifconfig for years, probably well over a decade. Anyway, at least on Debian, the package net-tools brings ifconfig it back, again with full multiple addresses support. # uname -v #1 SMP Debian 5.4.19-1 (2020-02-13) # ifconfig enp2s0: flags=4163 mtu 1500 inet 192.168.10.42 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::2e4d:54ff:fed…

ifconfig enp2s0:1 192.168.1.42 Now try ip addr add dev enp2s0 192.168.42.1/24 and observe how ifconfig ignores the second IP on the same interface. enp2s0:1 is an alias to enp2s0, not enp2s0 itself. To replicate your ifconfig command, you'd use ip addr add dev enp2s0 192.168.1.42/32 label enp2s0:1 and then it shows up in ifconfig as well.

Understood, thanks, I'm so used to ifconfig that always tried to avoid using ip. Time to learn it I guess.

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#73
post #13

Indeed, ip is vastly superior. But it took me almost a year of working with internet gateways (i.e as a day job) to let old habits die. Learning the new output format takes time. I've almost replaced route with "ip route" as well. arp isn't fully replaced yet in muscle memory. Also, as a comment on the article, ip can now fully replace brctl. (and iw replaces iwconfig and iwlist).

IP may be better from an ABI standpoint, but I still find its output to be much harder to parse with the Mk 1 Eyeball than ifconfig. Most of that is probably just ip shoving more information on the screen than ifconfig, but most of the information isn't useful 99% of the time and maybe it would be nicer if ip pared down some of the "qdisc noqueue state UNKNOWN group default" noise unless someone adds a "verbose" para…

While I agree that different defaults might be nice, modern versions of ip support a -br[ief] option which is pretty nice:

  $ ip -br a
  lo               UNKNOWN        127.0.0.1/8 ::1/128
  eth0             UP             10.123.45.67/24 fe80::7ed3:aff:fe51:4612/64
  $ ip -br l
  lo               UNKNOWN        00:00:00:00:00:00 
  eth0             UP             7c:d3:0a:51:46:12 

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#74

I really do not like the default UI in ip. You have to remember a lot of weird stuff to get useful information. The default listing is compressed, hard to read, and noisy. Then I saw someone who had these aliases: alias ipa 'ip -br -color a' alias ipl 'ip -br -color link' Night and day! I try to not use the aliases because I'm often on servers without them, but the options for brief and color with the command to list…

Thanks for sharing. That is very useful.

In case somebody is wondering the output looks like:

    $ ip -br -color a
    eth0             x.x.x.x/16 xxxx::xxxx:xxxx:xxxx:xxxx/64
    lo               127.0.0.1/8 ::1/128
    wifi0            x.x.x.x/24 xxxx::xxxx:xxxx:xxxx:xxxx/64
    wifi1            x.x.x.x/16 xxxx::xxxx:xxxx:xxxx:xxxx/64
    wifi2            x.x.x.x/16 xxxx::xxxx:xxxx:xxxx:xxxx/64

    $ ip -br -color link
    eth0             xx:xx:xx:xx:xx:xx 
    lo               00:00:00:00:00:00 
    wifi0            xx:xx:xx:xx:xx:xx 
    wifi1            xx:xx:xx:xx:xx:xx 
    wifi2            xx:xx:xx:xx:xx:xx 

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#75
Linux's stable kernel ABI makes tools like rr and strace much easier to maintain. It sounds like maintaining rr for FreeBSD would be harder since you'd have to keep updating its syscall model for changes to existing syscalls as well as new syscalls. And that's if we only supported the latest FreeBSD in each rr version; supporting multiple versions of FreeBSD would require a lot more code.

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#76
post #10

It's not quite that simple. People actually tried to update net-tools ifconfig (one of the two ifconfigs back in 2018). In 2019, I simply wrote an ifconfig that uses the netlink API, because for portability I needed a Linux ifconfig that had a FreeBSD-like command-line syntax. It doesn't have the old interface aliasing mentioned in the headlined article, and has no problems setting up and reporting IPv6 addresses or…

Off-topic: I can't help but be nosy and check the https version of your page. You seem to be serving a cert with CN=albertstreetantiquescentre.co.uk. Might want to get this looked at :)

Edit: Interesting,

https://jdebp.uk has the correct cert configured, whereas https://jdebp.uk. serves the cert as mentioned above.

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#77
post #69

Earlier quoted context omitted.

Why are you using the dot for your site but not for stackexchange?

This might be the first time in quite a few years that I've seen people using a dot like that. Any reasons to do so? I figured most people do not have weird DNS search domains or some such to warrant that dot.

It would be good practice to do so, when you are referring to a FQDN.

Apart from that, to circumvent badly configured paywall filters?

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#78
post #73

Earlier quoted context omitted.

IP may be better from an ABI standpoint, but I still find its output to be much harder to parse with the Mk 1 Eyeball than ifconfig. Most of that is probably just ip shoving more information on the screen than ifconfig, but most of the information isn't useful 99% of the time and maybe it would be nicer if ip pared down some of the "qdisc noqueue state UNKNOWN group default" noise unless someone adds a "verbose" para…

While I agree that different defaults might be nice, modern versions of ip support a -br[ief] option which is pretty nice: $ ip -br a lo UNKNOWN 127.0.0.1/8 ::1/128 eth0 UP 10.123.45.67/24 fe80::7ed3:aff:fe51:4612/64 $ ip -br l lo UNKNOWN 00:00:00:00:00:00 eth0 UP 7c:d3:0a:51:46:12

'ip -br a' get real messy if you have IP6 unfortunately. IPv6 hosts like to make lots and lots of addresses, which all get smooshed together on a single line of hard-on-the-eyeballs hex noise.

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#79
post #76
post #10

It's not quite that simple. People actually tried to update net-tools ifconfig (one of the two ifconfigs back in 2018). In 2019, I simply wrote an ifconfig that uses the netlink API, because for portability I needed a Linux ifconfig that had a FreeBSD-like command-line syntax. It doesn't have the old interface aliasing mentioned in the headlined article, and has no problems setting up and reporting IPv6 addresses or…

Off-topic: I can't help but be nosy and check the https version of your page. You seem to be serving a cert with CN=albertstreetantiquescentre.co.uk. Might want to get this looked at :) Edit: Interesting, https://jdebp.uk has the correct cert configured, whereas https://jdebp.uk . serves the cert as mentioned above.

That's the page on a shared hosting service, not served by me. See the site history page (still in the same place that it was a couple of years ago when it came up on Hacker News).

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#80
post #77
post #69

Earlier quoted context omitted.

This might be the first time in quite a few years that I've seen people using a dot like that. Any reasons to do so? I figured most people do not have weird DNS search domains or some such to warrant that dot.

It would be good practice to do so, when you are referring to a FQDN. Apart from that, to circumvent badly configured paywall filters?

You both need to read http://jdebp.uk./FGA/web-fully-qualified-domain-name.html , including the Hacker News person's reminiscences. (-:
Post reply on HN