Deprecated Linux networking commands and their replacements
dougvitale.wordpress.com
dougvitale.wordpress.com
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.
So regardless of upgrading it, it's definitely not a good command to use. The infiniband one isn't the only case.
I have Debian 9 and I don't see it in my `man ifconfig`!
$ 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). $ sudo dnf provides /usr/sbin/ifconfig
net-tools-2.0-0.42.20160912git.fc26.x86_64 : Basic networking tools
Repo : @SystemI believe this patch originates from Fedora, but I don't know how to get Fedora source for this RPM. :-\
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)
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).
>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.
Breaking changes is very uncool.
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.
This program is obsolete!
Hm, I don't see that in man for ifconfig in Debian.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...
Edit: Also, I wasn't aware that the old commands were deprecated and definitely didn't have a handy one-to-one conversion reference like this link. So +1 for that
Weird. At first I thought it might be due to tabs, but it appears to be using spaces.
i have come to very much appreciate the consistency and discoverability of the iproute2 cli.
It seems pretty clear unlearning the old and learning the new is more work than learning it for the first time, which may be why so many old-timers are so disagreeable to changes like this, even if the new is clearly superior (and for the average user, these may not be clearly superior enough to justify extra effort). Hell, I caught myself typing an ipchains command a week or so ago (while I'm busy learning about nftables which replaces iptables/ip6tables!), and I haven't had a system that had ipchains in more than a decade.
Go ahead, search with your favorite web crawler. Something simple like "command line ip address".
It will tell you to use ifconfig -a.
nftables works well and has been available in mainline Linux for a few years, but there's little support for it at the distribution and tools and documentation level. AFAIK, things like firewalld and other firewall management tools don't support it yet (though firewalld will support it transparently when it does arrive, so if you use firewalld to manage your iptables firewalls, it'll probably Just Work when switching to nftables). We don't yet support it in our products (while we do support firewalld, iptables, and some third party firewall management tools like CSF have modules for Webmin).
iptables continues to be supported at all levels, so there is no urgency to switching, though nftables is clearly superior in nearly every way. It's an awesome tool, but adoption has been very, very slow. I think that's unfortunate, as it's an area where I'd be willing to learn new things. nft has really clean syntax with super powerful abstractions and hooks into the kernel.
So, if you manage a lot of Linux firewalls, or a few very complex ones, maybe you want to switch already...I would, if I were in that situation. But, I just use firewalld, because my firewall needs are minimal these days.
I personally cant wait for pfsense quality products to come on Linux.
It's "only" been four years since nftables made it to mainline kernel, so we're not quite into Python 3 territory, but I wouldn't be surprised if we're still having this conversation in five more years. There's just no movement toward nftables, at all, that I perceive. I think it's partly because firewalls matter less today than they once did. So much is in the cloud now, where the firewall is somebody else's problem. It might even end up being a Perl 5->6 situation, but we won't know for a few more years.
ip -s a
If you want human readable byte/packet numbers ip -s -h a
`ip` is actually really cool once you get to know all the features. I missed seeing ifconfig's familiar output but got over it rather (suprisingly) quickly. ip -s a s <interface>
or ip -s -h a s <interface> ip -s -h a
doesn't work on the older version (`iproute2-ss131122`) but does on `iproute2-ss151103`Fwiw you don't need to be a sysadmin to have known of ifconfig. Hell how is it possible to have set up networking on Linux distributions without knowing this command?
I'm not a sysadmin, but I use Linux every day. Just can't keep up anymore...
Lxde brought in WiCD for wifi, which is fine, except when attempting to connect in a location with a very large number of Wifi connections available (anything over 70 different ones) it would not connect. Further investigation revealed a 'too much output' error from the iwlist scan command (this is from memory).
Worked fine at home and in most of my usual 'third space' locations of course because way less than 70ish connections.
Booting into a live USB with network-manager on it and googling lead to my discovery of the depreciation.
ss -4tanpioe state establishedthis post is very useful, hope the author can make a github page for it...
Like i didn't dislike it enough already. Would not surprise me if it had the Poettering stamp of approval...
The WTF sense.
The Linux kernel's promise not to break userspace means lots of ancient shit still works even though maybe it shouldn't...