All About ifconfig
There are many more parameters to ifconfig than we have described so far. Its normal invocation is this:
ifconfiginterface[address[parameters]]
interface is the interface name, and
address is the IP address to be assigned to the
interface. This may be either an IP address in dotted quad notation or a
name that ifconfig will look up in
/etc/hosts.
If ifconfig is invoked with only the interface
name, it displays that interface’s configuration. When invoked without
any parameters, it displays all interfaces you have configured so far;
a -a option forces it to show the inactive ones
as well. A sample invocation for the Ethernet interface
eth0 may look like this:
# ifconfig eth0
eth0 Link encap 10Mbps Ethernet HWaddr 00:00:C0:90:B3:42
inet addr 172.16.1.2 Bcast 172.16.1.255 Mask 255.255.255.0
UP BROADCAST RUNNING MTU 1500 Metric 0
RX packets 3136 errors 217 dropped 7 overrun 26
TX packets 1752 errors 25 dropped 0 overrun 0
The MTU and Metric fields show the
current MTU and metric value for that interface. The metric value is
traditionally used by some operating systems to compute the cost of a route.
Linux doesn’t use this value yet, but defines it for compatibility,
nevertheless.
The RX and TX lines show how many packets have been received or transmitted error free, how many errors occurred, how many packets were dropped (probably because of low memory), and how many were lost because of an overrun. Receiver overruns usually occur when packets come in faster ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access