Hacker News new | past | comments | ask | show | jobs | submit login

The first thing I do on any Linux machine is set up an `ifconfig` alias in my shell. That's a command that I've been using for a lot longer than some of these distributions have been around.

From the man page documentation for ifconfig:

> This program is obsolete! For replacement check ip addr and ip link. For statistics use ip -s link.

and

> Ifconfig uses obsolete kernel interface. It uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes. Since an Infiniband address is 20 bytes, only the first 8 bytes of Infiniband address are displayed.

I don't understand why ifconfig couldn't be upgraded to use whatever the new IOCTL that is compatible with 20b+ addresses instead of being deprecated for favor of a new command entirely.

Fortunately, my FreeBSD servers all take ifconfig out-of-the-box... and even my Linux shell under Windows does, too.




There are two main reasons:

1. net-tools is a completely separate project while iproute is closely related to the kernel. On FreeBSD, userland is kept in sync with kernel. 2. ifconfig output was parsed by programs and difficult to extend without breaking everything. iproute output is extensible and less likely to break programs.

As a side node, net-tools development has resumed recently. Output of ifconfig has changed but not much else. https://sourceforge.net/p/net-tools/mailman/message/35509868...


You might want to look into the history of net-tools and iproute2. `net-tools` was a big UNIX thing. That is the reason FreeBSD still uses it.

Since 2001 (!) `net-tools` hasn't been developed (!= supported) in linux. That's a heck of long time.

It isn't just about the about correcting the ioctl call, it is about re-engineering the complete suite of networking commands in net-tools. The iproute2 suite doesn't get stuff from /proc and ioctl calls, but rather does through netlink (because ioctl calls were being (ab)used a lot). So it is more performant.

It might seem absurd to optimize for performance, but its really not because its usage in scripts warrants it (especially because `iproute2` does a lot, lot more than what `net-tools` does)


It's clearly too late for this battle, but I think this is a clear picture of 'Linux philosophy' vs 'BSD philosophy':

Ifconfig could have been augmented to support the new, performant ways to do the things, and the new, cool things; but instead, a new tool was developed and the old one deprecated. In FreeBSD, you still use ifconfig to configure interfaces, including wireless interface parameters, instead of another thing for that (iwconfig).


Churn and reinventing the wheel accomplishes nothing but creating busywork for many hundreds of thousands of users, creates an unnecessary learning curve and wastes time. They should've just fixed/rewrite net-tools for new interfaces and added flags for parsable output.

Breaking changes is very uncool.


Even Linus Torvalds dislike the ip command.

https://lkml.org/lkml/2015/1/1/128

And whenever i try to use it i find myself reminded, and not in any pleasant sense, of a crappy Cisco IOS clone.

The whole thing feels more at home as the default shell on a router than a tool on any desktop or server.


I know what you mean, and agree to some extent. But I doubt that statement holds up in this case.

>Ifconfig could have been augmented to support the new, performant ways to do the things, and the new, cool things;

I don't think that could've happened. You are thinking very narrowly, just about ifconfig command. Linux has a lot more networking things that aren't there in UNIX (or even in the BSDs for that matter). There have been many networking concepts introduced in linux that would warrant creating a completely different set of tools.

Ofcourse, shoehorning all the new features behind current net-tools binaries is an option. But if you see the elegance in the current with which `ip` can be used, I think you would reconsider your stance.


On which Linux distribution did you find the "This program is obsolete!" note in `man ifconfig`?

I have Debian 9 and I don't see it in my `man ifconfig`!


Fedora 26.

    $ sudo dnf provides /usr/sbin/ifconfig
    net-tools-2.0-0.42.20160912git.fc26.x86_64 : Basic networking tools
    Repo        : @System


https://git.centos.org/raw/rpms/net-tools.git/c7/SOURCES!net...

I believe this patch originates from Fedora, but I don't know how to get Fedora source for this RPM. :-\


Go install ifconfig somehow and try again, Debian ships with a wrapper I believe.


Not a wrapper, it seems:

    $ file /sbin/ifconfig 
    /sbin/ifconfig: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=6bf40c44a9b42715a7670365936e6d0aa16f7bf1, stripped
    $ dpkg -S /sbin/ifconfig
    net-tools: /sbin/ifconfig
And my man page does not show anything about it being obsolete (Debian buster).


    This program is obsolete!
Hm, I don't see that in man for ifconfig in Debian.


As a side note, ifconfig will not even show all of your IP addresses if they don't have an alias.

So regardless of upgrading it, it's definitely not a good command to use. The infiniband one isn't the only case.


I've always struggled with the fact that only root can use ifconfig on Suse. I only recently became aware of this, but I do see that non-root users can run 'ip a'.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: