ip versus ifconfig
Solution 1
Simple answer: On Linux ifconfig
is obsolete.
From man ifconfig
:
This program is obsolete! For replacement check
ip addr
andip link
. For statistics useip -s link
.
Solution 2
From Why iproute2?:
Most Linux distributions, and most UNIX's, currently use the venerable arp, ifconfig and route commands. While these tools work, they show some unexpected behaviour under Linux 2.2 and up. For example, GRE tunnels are an integral part of routing these days, but require completely different tools.
With iproute2, tunnels are an integral part of the tool set.
The 2.2 and above Linux kernels include a completely redesigned network subsystem. This new networking code brings Linux performance and a feature set with little competition in the general OS arena. In fact, the new routing, filtering, and classifying code is more featureful than the one provided by many dedicated routers and firewalls and traffic shaping products.
As new networking concepts have been invented, people have found ways to plaster them on top of the existing framework in existing OSes. This constant layering of cruft has lead to networking code that is filled with strange behaviour, much like most human languages. In the past, Linux emulated SunOS's handling of many of these things, which was not ideal.
This new framework makes it possible to clearly express features previously beyond Linux's reach.
Related videos on Youtube
Pylsa
SO has abandoned its ideals some time ago https://meta.stackexchange.com/questions/333965/firing-mods-and-forced-relicensing-is-stack-exchange-still-interested-in-cooper https://meta.stackexchange.com/questions/342039/firing-community-managers-stack-exchange-is-not-interested-in-cooperating-with https://meta.stackexchange.com/questions/336526/stack-overflow-is-doing-me-ongoing-harm-its-time-to-fix-it https://meta.stackexchange.com/questions/336731/to-reach-out-on-monica-the-lavender-community-and-the-future-of-the-stack-exc/336760#336760 https://meta.stackexchange.com/questions/336639/what-if-anything-can-se-do-to-resolve-the-ongoing-conflict-in-a-timely-way/336642#336642 https://meta.stackexchange.com/questions/336177/feedback-post-moderator-review-and-reinstatement-processes/336280#336280
Updated on September 17, 2022Comments
-
Pylsa almost 2 years
After reading this answer, I began my quest for the difference between
ip
andifconfig
for *nix systems. I soon learned thatip
had "more" features thanifconfig
, but what's the real difference? Is there any reason not to useifconfig
when it provides the functions I need? (E.g. security implications) Like to know since I'm an avidifconfig
user. -
Pylsa over 13 yearsBut does that include negative side effects when using it?
-
slhck almost 12 yearsCan you please expand your answer and tell us why, what are the drawbacks, why it's superseded, et cetera?
-
Andrejs Cainikovs almost 12 yearsThis is clearly stated in
man ifconfig
: linux.die.net/man/8/ifconfig -
pilona almost 11 years@BloodPhilia: Some old kernels (may be custom, patched), have, in the field, behaved oddly when using
ip
orss
. Otherwise, it should jus t work for systems with a relatively modern kernel and userspace.