Name
ifconfig — stdin stdout - file -- opt --help --version
Synopsis
ifconfig [options
]interface
The ifconfig
command is an
ancestor of ip
. It is still found
on many Linux systems but is less powerful (some would call it
obsolete). We’ll cover a few simple commands here, but you should be
using ip
instead.
To display information about the default network interface (usually called eth0):
$ ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:50:BA:48:4F:BA inet addr:192.168.0.10 Bcast:192.168.0.255 ... UP BROADCAST RUNNING MULTICAST MTU:1500 ... RX packets:1955231 errors:0 dropped:0 overruns:0 ... TX packets:1314765 errors:0 dropped:0 overruns:0 ... collisions:0 txqueuelen:100 ...
This includes your MAC address (00:50:BA:48:4F:BA), your IP address (192.168.0.21), your netmask (255.255.255.0), and various other information. To view all loaded network interfaces, run:
$ ifconfig -a
Get Linux Pocket Guide, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.