Network

ifconfig

Configure and display network interface parameters (legacy, prefer ip command).

Synopsis

syntax
ifconfig [INTERFACE] [OPTIONS]

Examples

Show active network interfaces
ifconfig
Show all interfaces including inactive
ifconfig -a
Show specific interface details
ifconfig eth0
Set IP address
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0

Common options

FlagDescription
upActivate interface
downDeactivate interface
netmaskSet subnet mask
-aDisplay all interfaces including down ones

About ifconfig

The `ifconfig` command configure and display network interface parameters (legacy, prefer ip command). Networking commands handle connectivity testing, DNS resolution, data transfer, remote access, firewall rules, and traffic analysis.

Linux is the dominant server operating system, and strong networking skills are essential for web hosting, container orchestration, security auditing, and infrastructure management. The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man ifconfig`).

The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Network Commands

Other commands in the Network category

Related tools