26 ms·
Deprecated Linux networking commands and their replacements
- efoto 9y agoThe post is from 2011 and it's been awhile since I started using 'ip' instead of 'ifconfig', but everybody, myself included, seem to continue using 'netstat' and not 'ss'.
- inetknght 9y agoOld habits die hard. Also, I don't particularly like having to learn _yet another_ command to get what I want. It's bad enough having to learn differences between operating systems. Learning differences between operating system _versions_ is really quite annoying. Add in a healthy dose of bias (I seem to recall seeing one of these commands was just a python script instead of a compiled program), skepticism (about it being 'better'? it's different, for sure, I don't know about 'better'; it doesn't appear to use the normal command line switch methods, so that's definitely not better! and, one command which has to parse subcommands? that flows against the old adage of "have one purpose, do it well"...), and paranoia (why change it? why? the old one was just fine and did exactly what I wanted!); you end up with an old guy like me stuck in his ways. 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
- keeperofdakeys 9y agoI like most if the new tools, but the 'ss' command produces output that's hard to skim. When outputting to a terminal it tries to justify the columns, hiding some information on the next line. When you pipe it through cat (so it can't detect a tty), the columns don't even line up.
- vacri 9y ago> When you pipe it through cat (so it can't detect a tty), the columns don't even line up. Weird. At first I thought it might be due to tabs, but it appears to be using spaces.
- inetknght 9y agoHonestly, why people don't use tabs in terminals is beyond me. It's easier to parse in nearly every case that doesn't involve a text editor of some sort.
- xearl 9y agointerestingly enough, `ss` (usually w/`-ltun`) was the first thing i successfully reprogrammed my muscle memory to (after 12y+ of using netstat). `ip r` instead of `route` being a close second. i have come to very much appreciate the consistency and discoverability of the iproute2 cli.
- ConfucianNardin 9y agoIt doesn't help that the -p output from ss is completely unreadable in comparison to that of netstat.
- edgan 9y agoThe ss program also seems to be missing the feature to show you the username or uid or that the process is running as. It is a useful feature of netstat.
- ComputerGuru 9y agoThe 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.
- lathiat 9y agoAs 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.
- pnutjam 9y agoI'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'.
- foo101 9y agoOn 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`!
- boomboomsubban 9y agoGo install ifconfig somehow and try again, Debian ships with a wrapper I believe.
- gsich 9y agoifconfig is far superior to ip, depending on the use case. Mostly I want to see the current IP, MAC, amount of traffic transfered. Sometimes MTU. Can't do that with one command in ip.
- ktta 9y agoip -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.
- tssva 9y agoIf you want the info for a specific interface ip -s a s <interface> or ip -s -h a s <interface>
- gsich 9y agobut how is that better then ifconfig? with this I see bytes/packets. But not IP, for that I have to use a different command...
- ktta 9y agoHave you actually tried using the command in my comment?
- isatty 9y agoip -s -h a doesn't work on the older version (`iproute2-ss131122`) but does on `iproute2-ss151103`
- deleted 9y ago[deleted]
- est 9y agocant recommand ss enough. ss -4tanpioe state established
- ktta 9y agoThis[1] page covers a lot more commands. I didn't even know it was possible to do some of those in linux without installing more packages. It is very long so I would just bookmark it. [1]:http://baturin.org/docs/iproute2/ http://baturin.org/docs/iproute2/
- dmourati 9y agoFlame bait title. I know some of these but not all. All the supposedly deprecated commands still work six years after posting.
- ktta 9y agoSure, they work, but they are deprecated and/or not recommended to be used in major linux distros.
- astrodust 9y agoIt's not flame bait, the article explains: These things aren't even on life support, they're adrift in space, dead.
- awalton 9y ago'Deprecated' means "stop using this", not "this doesn't work anymore", albeit the former usually implies the latter, especially over time. The Linux kernel's promise not to break userspace means lots of ancient shit still works even though maybe it shouldn't...
- nailer 9y agoAlso ifconfig doesn't work at all in some cases. Virtual IP on a vlan on a bond, liks most trading systems use? Won't show up.
- erobbins 9y agoso I see "not apparent" in many replacement columns... which means the original is not deprecated at all, but still the only show in town.
- boomboomsubban 9y agoNo, it means the author didn't find it in their research time. Which seems crazy, one of them is "iptunnel -v" and version is the first flag covered in the ip man page
- ausjke 9y agoip is a great tool, the only thing I am still not used to is that, ip's output is more like for machines instead of human to digest, at least for me. I feel a sugar wrapper is needed for more enjoyable reading on the terminal. this post is very useful, hope the author can make a github page for it...
- SwellJoe 9y agoMy fingers still type ifconfig, netstat, and route, and then I correct myself usually before hitting enter (though that took at least a couple of years). The new commands are more consistent, and more logically laid out so I can't argue against switching...but, my muscle memory doesn't know them yet (despite having started switching years ago). 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.
- bittermang 9y agoNow if we can just teach the Internet how to unlearn. Go ahead, search with your favorite web crawler. Something simple like "command line ip address". It will tell you to use ifconfig -a.
- sandGorgon 9y agois nftables production ready ? or is everyone still at iptables/ipchains ?
- SwellJoe 9y agoYou're fine sticking with iptables for now, if you don't experience any pain from it. ipchains has been compltely dead for well over a decade (which is why it's so ridiculous that I'd start typing an ipchains command); iptables arrived in 2001 and was on everything by the mid-2000s. The difference with that transition was that you couldn't keep using ipchains, because it was replaced by iptables. nftables co-exists with iptables. 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.
- shmerl 9y agoGood to know that ifconfig is supposed to he phased out. I'm not a sysadmin, so I've never heard about it.
- isatty 9y agoYour comment doesn't make sense. Why is it good to know that a command that you haven't even heard about is phased out? 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?
- shaklee3 9y agoI think he means he hadn't heard about it being phased out.
- mathw 9y agoMmm. I had no idea either. I was surprised to see how old the linked article is! I'm not a sysadmin, but I use Linux every day. Just can't keep up anymore...
- pnutjam 9y agoI'm a sysadmin and I hadn't heard this until last year. It explains why only root can do an ifconfig on SLES, but anyone can run 'ip a'
- shmerl 9y agoIn Debian both of them sit in /sbin so it boils down to whether /sbin is in the PATH by default. I think it better should be, rather than not.
- keithpeter 9y agoEnd user here: I found out about all this when I installed Debian 9 with the lxde desktop. 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.
- aexaey 9y agoiw is not quite a complete replacement for iwconfig and iwlist. Former don't support some network card drivers, such as [1]. So if you happen to have one of those, you have to use latter two, deprecated or not. [1] https://github.com/lwfinger/rtl8188eu/ https://github.com/lwfinger/rtl8188eu/
- mschuster91 9y agoHmm. Problem is, ifconfig and netstat are available on OS X too, while ip and ss are not...
- a3n 9y agoFrom a casual net commands user POV, I like that 'ip' plus a sub-command has taken over a good part of this. It's nice to look in one man page, and discover other things ip does, without having to be aware (or ignorant!) of other commands.
- gbrown_ 9y agoMy favorite feature of ip(8) is its ability to load kernel modules https://twitter.com/lucabruno/status/902934379835662336 https://twitter.com/lucabruno/status/902934379835662336