ifconfig
networkingLinux/Unix
The ifconfig command is one of the most frequently used commands in Linux/Unix-like operating systems. ifconfig Configure or display network interface parameters
Quick Reference
Command Name:
ifconfig
Category:
networking
Platform:
Linux/Unix
Basic Usage:
ifconfig [options] [arguments]
Common Use Cases
Syntax
ifconfig [interface] [options] [address]
Options
Option | Description |
---|---|
up |
Activate the interface |
down |
Deactivate the interface |
netmask addr |
Set the network mask |
broadcast addr |
Set the broadcast address |
pointopoint addr |
Set the point-to-point address for an interface |
hw ether addr |
Set the hardware/MAC address |
mtu N |
Set the Maximum Transmission Unit |
promisc |
Enable promiscuous mode (receive all packets) |
-promisc |
Disable promiscuous mode |
arp |
Enable ARP protocol on this interface |
-arp |
Disable ARP protocol on this interface |
multicast |
Enable multicast support for this interface |
-multicast |
Disable multicast support for this interface |
allmulti |
Enable all-multicast mode (receive all multicast packets) |
-allmulti |
Disable all-multicast mode |
txqueuelen N |
Set the transmit queue length |
add addr/prefixlen |
Add an IPv6 address to an interface |
del addr/prefixlen |
Remove an IPv6 address from an interface |
Examples
How to Use These Examples
The examples below show common ways to use the ifconfig
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
ifconfig