LinuxCommandLibrary

ifconfig

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.
The tool is being replaced by ip command but remains widely used. It shows interface statistics and configuration.
ifconfig manages network interfaces.

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.
--help
Display help information.

CAVEATS

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

HISTORY

ifconfig is a traditional Unix network configuration tool, now superseded by iproute2 ip command.

SEE ALSO

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

Copied to clipboard