Linux based distributions have featured set of commands which provide way to configure networking in easy and powerful way through command-line. These set of commands are available from net-tools package which has been there for a long time on almost all distributions, and includes commands like: ifconfig, route, nameif, iwconfig, iptunnel, netstat, arp.
This alternative has also been there for quite some time now and is much more powerful than any of these commands. Rest of sections would highlight this alternative and compare it with one of the command from net-tools package i.e. ifconfig.
ip – A Replacement for ifconfig
ifconfig has been there for a long time and is still used to configure, display and control network interfaces by many, but a new alternative now exists on Linux distributions which is much more powerful than it. This alternative is
ip
command from iproute2util package.
Although this command might seem a bit complex at first site but it is much broader in functionality than ifconfig. It is functionally organized on two layers of Networking Stack i.e. Layer 2 (Link Layer), Layer 3 (IP Layer) and does the work of all the above mentioned commands from net-tools package.
While ifconfig mostly displays or modifies the interfaces of a system, this command is capable of doing following tasks:
- Displaying or Modifying Interface properties.
- Adding, Removing ARP Cache entries along creating new Static ARP entry for a host.
- Displaying MAC addresses associated with all the interfaces.
- Displaying and modifying kernel routing tables.
One of the main highlight which separates it from its ancient counterpart ifconfig is that latter uses ioctl for network configuration, which is a less appreciated way of interaction with kernel while former takes advantage of netlink socket mechanism for the same which is a much more flexible successor of ioctl for inter-communication between kernel and user space using rtnetlink (which adds networking environment manipulation capability).
We can now begin to highlight the features of ifconfig and how they are effectively replaced by ip command.
No comments:
Post a Comment