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 (e.g. `hw ether AA:BB:...`).
promisc / -promisc
Enable or disable promiscuous mode.
arp / -arp
Enable or disable ARP protocol on the interface.
multicast / -multicast
Enable or disable multicast flag.
add ADDR/PREFIX
Add an IPv6 address to the interface.
del ADDR/PREFIX
Remove an IPv6 address from the interface.
--help
Display help information.

INSTALL

sudo apt install net-tools
copy
sudo dnf install net-tools
copy
sudo pacman -S net-tools
copy
sudo apk add net-tools
copy
sudo zypper install net-tools
copy
brew install net-tools
copy
nix profile install nixpkgs#net-tools
copy

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)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid