FreeBSD vs. Linux – Networking
As we covered in “History of FreeBSD Part 4: BSD and TCP/IP”, TCP/IP was brought to Unix with BSD first. Many common network utilities like ifconfig, route and netstat date back to the 4.2BSD release and spread from there to other Unix systems. Linux started out with similar utilities modelled on the BSD utilities; these packages continue to be widely available, but most modern Linux distributions have deprecated them in favor of alternate utilities such as ip(8).
The change on Linux came about alongside a redesign of the kernel interfaces where use of the ioctl(2) system call was replaced by a more flexible socket based interface called netlink. Interestingly, netlink support was recently added to FreeBSD and should be available in FreeBSD 14. This is mainly relevant to the use of the linuxulator, for running Linux applications and containers, but should also make it easier to port Linux software to FreeBSD.
The Linux ip tool loosely corresponds to ifconfig on FreeBSD, but the arguments take a different form. ip takes a list of sub-commands in a strict and structured order. ifconfig takes an interface device as its first argument and the arguments that follow specify options or actions where the ordering is more flexible.