Ifconfig
   HOME

TheInfoList



OR:

ifconfig (short for ''interface config'') is a system administration utility in
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating systems for network interface configuration. The utility is a
command-line interface A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
tool and is also used in the system startup scripts of many operating systems. It has features for configuring, controlling, and querying
TCP/IP The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
network interface parameters. Ifconfig originally appeared in 4.2BSD as part of the
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
TCP/IP suite. Many Linux distributions have deprecated ifconfig in favor of tools from
iproute2 iproute2 is a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel, including routing, network interfaces, tunnels, traffic control, and network-related device drivers. Project ...
.


Usage

Common uses for ifconfig include setting the
IP address An Internet Protocol address (IP address) is a numerical label such as that is assigned to a device connected to a computer network that uses the Internet Protocol for communication. IP addresses serve two main functions: network interface i ...
and
subnet mask A subnet, or subnetwork, is a logical subdivision of an IP network. Updated by RFC 6918. The practice of dividing a network into two or more networks is called subnetting. Computers that belong to the same subnet are addressed with an identica ...
of a network interface and disabling or enabling an interface. At boot time, many Unix-like operating systems initialize their network interfaces with
shell script A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be command languages. Typical operations performed by shell scripts include file manipu ...
s 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 Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
-based host (interface eth0) and the ural0 interface on an
OpenBSD OpenBSD is a security-focused operating system, security-focused, free software, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking NetBSD ...
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 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
* HWaddr: ''hardware address'',
MAC address A MAC address (short for medium access control address or media access control 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 i ...
. * The parameter ''txqueuelen'' is measured in number of
Ethernet frame In computer networking, an Ethernet frame is a data link layer protocol data unit and uses the underlying Ethernet physical layer transport mechanisms. In other words, a data unit on an Ethernet link transports an Ethernet frame as its paylo ...
s and is the size of the buffer that is being managed by the
network scheduler A network scheduler, also called packet scheduler, queueing discipline (qdisc) or queueing algorithm, is an arbiter on a node in a packet switching communication network. It manages the sequence of network packets in the transmit and receive ...
.


Medium access control functions

ifconfig is also commonly used to change the
medium access control In IEEE 802 LAN/MAN standards, the medium access control (MAC), also called media access control, is the layer that controls the hardware responsible for interaction with the wired (electrical or optical) or wireless transmission medium. The ...
(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


Release status

The
Berkeley Software Distribution The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginn ...
UNIX Unix (, ; trademarked as 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, a ...
operating systems (e.g.,
NetBSD NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was fork (software development), forked. It continues to ...
,
OpenBSD OpenBSD is a security-focused operating system, security-focused, free software, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking NetBSD ...
, and
FreeBSD FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
) continue active development of ifconfig and extension of its functionality to cover the configuration of
wireless network A wireless network is a computer network that uses wireless data connections between network nodes. Wireless networking allows homes, telecommunications networks, and business installations to avoid the costly process of introducing cables int ...
ing interfaces,
VLAN A virtual local area network (VLAN) is any broadcast domain that is partitioned and isolated in a computer network at the data link layer ( OSI layer 2).IEEE 802.1Q-2011, ''1.4 VLAN aims and benefits'' In this context, virtual refers to a ...
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 distribution A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s, 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. Many Linux distributions have deprecated the use of ifconfig and route in favor of the software suite
iproute2 iproute2 is a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel, including routing, network interfaces, tunnels, traffic control, and network-related device drivers. Project ...
, such as ArchLinux or RHEL since version 7, which has been available since 1999 for Linux 2.2. 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.


Related tools

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 server A name server is a computer application that implements a network service for providing responses to queries against a directory service. It translates an often humanly meaningful, text-based identifier to a system-internal, often numeric identi ...
s to use. The command is configured using the file ''/etc/network/interfaces'', which contains "stanzas" for each interface.
NetworkManager NetworkManager is a daemon that sits on top of libudev and other Linux kernel interfaces (and a couple of other daemons) and provides a high-level interface for the configuration of the network interfaces. Rationale NetworkManager is a software ...
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 Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
from
Windows 95 Windows 95 is a consumer-oriented operating system developed by Microsoft and the first of its Windows 9x family of operating systems, released to manufacturing on July 14, 1995, and generally to retail on August 24, 1995. Windows 95 merged ...
to
Windows Me Windows Me (Millennium Edition) is an operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the successor to Windows 98, and was released to manufacturing on June 19, 2000, and t ...
used winipcfg to give a graphical display of current IP information.
ipconfig ipconfig (standing for "Internet Protocol configuration") 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) ...
, a command similar to ifconfig, comes with
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
operating-systems based on the
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
kernel.
ipconfig ipconfig (standing for "Internet Protocol configuration") 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) ...
also controls the Windows
DHCP The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a clie ...
client. In
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, 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 A wireless network is a computer network that uses wireless data connections between network nodes. Wireless networking allows homes, telecommunications networks, and business installations to avoid the costly process of introducing cables int ...
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 Deprecation is the discouragement of use of something human-made, such as a term, feature, design, or practice. Typically something is deprecated because it is claimed to be inferior compared to other options available. Something may be deprec ...
ifconfig.


See also

* Consistent Network Device Naming *
Ipconfig ipconfig (standing for "Internet Protocol configuration") 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) ...
*
Iproute2 iproute2 is a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel, including routing, network interfaces, tunnels, traffic control, and network-related device drivers. Project ...


References


External links


ifconfig(8)
official
manpage A man page (short for manual page) is a form of software documentation found on Unix and Unix-like operating systems. Topics covered include programs, system libraries, system calls, and sometimes local system details. The local host administ ...
for Linux net-tools ifconfig
ifconfig(8)
manpage for the
FreeBSD FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
ifconfig
ifconfig(8)
manpage for the Solaris ifconfig {{Unix commands OS/2 commands Routing Unix network-related software