Initial release | August 1983 |
---|---|
Operating system | Unix and Unix-like |
Type | Command |
ifconfig (short for interface config) is a system administration utility in Unix-like operating systems for network interface configuration.
The utility is a command-line interface tool and is also used in the system startup scripts of many operating systems. It has features for configuring, controlling, and querying TCP/IP network interface parameters. Ifconfig originally appeared in 4.2BSD as part of the BSD TCP/IP suite.
Many Linux distributions have deprecated ifconfig in favor of tools from iproute2.
Common uses for ifconfig include setting the IP address and subnet mask of a network interface and disabling or enabling an interface. [1] At boot time, many Unix-like operating systems initialize their network interfaces with shell scripts that call ifconfig. As an interactive tool, system administrators routinely use the utility to display and analyze network interface parameters. The following two examples show the output of the tool when querying the state of a single active interface each on a Linux-based host (interface eth0) and the ural0 interface on an OpenBSD installation.
eth0 Link encap:Ethernet HWaddr 00:0F:20:CF:8B:42 inet addr:192.168.1.128 Bcast: Mask:255.255.255.192 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2472694671 errors:1 dropped:0 overruns:0 frame:0 TX packets:44641779 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1761467179 (1679.7 Mb) TX bytes:2870928587 (2737.9 Mb) Interrupt:28
ural0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:0d:0b:ed:84:fb media: IEEE802.11 DS2 mode 11b hostap (autoselect mode 11b hostap) status: active ieee80211: nwid ARK chan 11 bssid 00:0d:0b:ed:84:fb 100dBm inet 172.30.50.1 netmask 0xffffff00 broadcast 172.30.50.255 inet6 fe80::20d:bff:feed:84fb%ural0 prefixlen 64 scopeid 0xa
ifconfig is also commonly used to change the medium access control (MAC) address of an interface. In this process, the network interface is first disabled (set down) with the ifconfig command, followed by a MAC change command:
ifconfig wlan0 down ifconfig wlan0 hw ether 13:11:20:33:49:66 ifconfig wlan0 up
The Berkeley Software Distribution UNIX operating systems (e.g., NetBSD, OpenBSD, and FreeBSD) continue active development of ifconfig and extension of its functionality to cover the configuration of wireless networking interfaces, VLAN trunking, controlling hardware features such as TSO or hardware checksumming or setting up bridge and tunnel interfaces. Solaris has historically used ifconfig for all network interface configuration, but as of Solaris 10 introduced dladm to perform data-link (OSI model layer 2) configuration, reducing ifconfig's purview to IP configuration.
In older Linux distributions, ifconfig, in conjunction with the utility route, was used to connect a computer to a network, and to define routes between networks. ifconfig for Linux is part of the package net-tools, released as the latest version 2.10 on 7 January 2021. [2]
Many Linux distributions have deprecated the use of ifconfig and route in favor of the software suite iproute2, such as ArchLinux [3] or RHEL since version 7, [4] which has been available since 1999 for Linux 2.2. [5] iproute2 includes support for all common functions of ifconfig(8), route(8), arp(8) and netstat(1). It also includes multicast configuration support, tunnel and virtual link management, traffic control, and low-level IPsec configuration, among other features.
Another higher-level Linux command line tool is ifup (including ifdown and ifquery). In addition to controlling the interfaces, it also provides control of other aspects of the network such as specifying the DNS servers to use. The command is configured using the file /etc/network/interfaces, which contains "stanzas" for each interface.
NetworkManager is a Linux daemon that automatically reconfigures the network in dynamic environments, such as moving between WiFi hotspots. It is usually used in conjunction with a graphical front-end such as GNOME Shell.
Versions of Microsoft Windows from Windows 95 to Windows Me used winipcfg to give a graphical display of current IP information. ipconfig, a command similar to ifconfig, comes with Microsoft operating-systems based on the Windows NT kernel. ipconfig also controls the Windows DHCP client.
In macOS, the ifconfig command functions as a wrapper to the IPConfiguration agent, and can control the BootP and DHCP clients from the command-line. Use of ifconfig to modify network settings in Mac OS X is discouraged, because ifconfig operates below the level of the system frameworks which help manage network configuration.
iwconfig, a component of Wireless tools for Linux, which took its name from ifconfig, manages wireless network interfaces outside the original scope of Linux's ifconfig. iwconfig sets such specialized settings as a wireless network's SSID and WEP keys, and functions in tandem with iwlist. Linux also features iwspy, to read the signal, noise and quality of a wireless connection.
Other related tools for configuring Ethernet adapters are: ethtool, mii-tool, and mii-diag in Linux and the command dladm show-link in Solaris.
The ip suite has a similar purpose and is meant to replace the deprecated ifconfig. [6]
A MAC address is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment. This use is common in most IEEE 802 networking technologies, including Ethernet, Wi-Fi, and Bluetooth. Within the Open Systems Interconnection (OSI) network model, MAC addresses are used in the medium access control protocol sublayer of the data link layer. As typically represented, MAC addresses are recognizable as six groups of two hexadecimal digits, separated by hyphens, colons, or without a separator.
In computing, traceroute
and tracert
are computer network diagnostic commands for displaying possible routes (paths) and measuring transit delays of packets across an Internet Protocol (IP) network. The history of the route is recorded as the round-trip times of the packets received from each successive host in the route (path); the sum of the mean times in each hop is a measure of the total time spent to establish the connection. Traceroute proceeds unless all sent packets are lost more than twice; then the connection is lost and the route cannot be evaluated. Ping, on the other hand, only computes the final round-trip times from the destination point.
tcpdump is a data-network packet analyzer computer program that runs under a command line interface. It allows the user to display TCP/IP and other packets being transmitted or received over a network to which the computer is attached. Distributed under the BSD license, tcpdump is free software.
Network utilities are software utilities designed to analyze and configure various aspects of computer networks. The majority of them originated on Unix systems, but several later ports to other operating systems exist.
ipconfig
is a console application program of some computer operating systems that displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.
In computing, netstat
is a command-line network utility that displays network connections for Transmission Control Protocol, routing tables, and a number of network interface and network protocol statistics. It is available on Unix, Plan 9, Inferno, and Unix-like operating systems including macOS, Linux, Solaris and BSD. It is also available on IBM OS/2 and on Microsoft Windows NT-based operating systems including Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10.
netcat is a computer networking utility for reading from and writing to network connections using TCP or UDP. The command is designed to be a dependable back-end that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and investigation tool, since it can produce almost any kind of connection its user could need and has a number of built-in capabilities.
A default gateway is the node in a computer network using the Internet protocol suite that serves as the forwarding host (router) to other networks when no other route specification matches the destination IP address of a packet.
tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.
NetworkManager is a daemon that sits on top of libudev and other Linux kernel interfaces and provides a high-level interface for the configuration of the network interfaces.
In Unix-like operating systems, a loop device, vnd, or lofi is a pseudo-device that makes a computer file accessible as a block device.
In computer networking, TUN and TAP are kernel virtual network devices. Being network devices supported entirely in software, they differ from ordinary network devices which are backed by physical network adapters.
WaveLAN was a brand name for a family of wireless networking technology sold by NCR, AT&T, Lucent Technologies, and Agere Systems as well as being sold by other companies under OEM agreements. The WaveLAN name debuted on the market in 1990 and was in use until 2000, when Agere Systems renamed their products to ORiNOCO. WaveLAN laid the important foundation for the formation of IEEE 802.11 working group and the resultant creation of Wi-Fi.
Wireless tools for Linux is a collection of user-space utilities written for Linux kernel-based operating systems to support and facilitate the configuration of device drivers of wireless network interface controllers and some related aspects of networking using the Linux Wireless Extension. The Wireless tools for Linux and Linux Wireless Extension are maintained by Jean Tourrilhes and sponsored by Hewlett-Packard.
Operating system Wi-Fi support is defined as the facilities an operating system may include for Wi-Fi networking. It usually consists of two pieces of software: device drivers and applications for configuration and management.
Unix is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.
ptrace is a system call found in Unix and several Unix-like operating systems. By using ptrace one process can control another, enabling the controller to inspect and manipulate the internal state of its target. ptrace is used by debuggers and other code-analysis tools, mostly as aids to software development.
In computing, route
is a command used to view and manipulate the IP routing table in Unix-like and Microsoft Windows operating systems and also in IBM OS/2 and ReactOS. Manual manipulation of the routing table is characteristic of static routing.
ngrep is a network packet analyzer written by Jordan Ritter. It has a command-line interface, and relies upon the pcap library and the GNU regex library.
netsniff-ng is a free Linux network analyzer and networking toolkit originally written by Daniel Borkmann. Its gain of performance is reached by zero-copy mechanisms for network packets, so that the Linux kernel does not need to copy packets from kernel space to user space via system calls such as recvmsg
. libpcap, starting with release 1.0.0, also supports the zero-copy mechanism on Linux for capturing (RX_RING), so programs using libpcap also use that mechanism on Linux.