LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ifconfig

configures network interfaces

TLDR

Show all interfaces
$ ifconfig
copy
Show specific interface
$ ifconfig [eth0]
copy
Set IP address
$ sudo ifconfig [eth0] [192.168.1.100]
copy
Enable interface
$ sudo ifconfig [eth0] up
copy
Disable interface
$ sudo ifconfig [eth0] down
copy
Set netmask
$ sudo ifconfig [eth0] netmask [255.255.255.0]
copy

SYNOPSIS

ifconfig [interface] [options]

DESCRIPTION

ifconfig configures network interfaces. It displays and modifies IP addresses, netmasks, and interface status. Without arguments, it shows all active interfaces. With -a, it shows all interfaces including those that are down.The tool is part of net-tools and is being replaced by the ip command from iproute2, but remains widely used on many systems.

PARAMETERS

INTERFACE

Network interface name.
up
Activate interface.
down
Deactivate interface.
netmask MASK
Set network mask.
broadcast ADDR
Set broadcast address.
mtu SIZE
Set MTU size.
-a
Display all interfaces, even if down.
hw class address
Set hardware (MAC) address.
--help
Display help information.

CAVEATS

Deprecated for ip command. Part of net-tools. Root needed for changes.

HISTORY

ifconfig has been part of Unix networking since 4.2BSD (1983). On Linux it is part of the net-tools package, now largely superseded by iproute2.

SEE ALSO

ip(8), route(8), netstat(8)

Copied to clipboard
Kai