The ifconfig command can tell you a lot about your Unix server’s connection to your network and the role it’s playing in both generating and receiving network traffic.
The newer ip command does much the same thing, but you won’t find it on all varieties of Unix. Both commands will display a lot of settings and numbers associated with your network connection. Let’s look into what all those numbers and settings mean.
For starters, ifconfig stands for “interface configuration”. The command provides options for viewing as well as changing your network settings.
By itself (no options), the ifconfig command shows active network interfaces (you may have others). This is generally the primary network interface – usually eth0 – and the loopback address as shown in the example below.
$ ifconfig eth0 Link encap:Ethernet HWaddr 78:2B:CB:4E:B2:44 inet addr:172.30.0.28 Bcast:172.30.0.255 Mask:255.255.255.0 inet6 addr: fe80::890:52ff:fe31:1bdb/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4279184 errors:0 dropped:0 overruns:0 frame:0 TX packets:3979015 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:618520008 (589.8 MiB) TX bytes:827050668 (788.7 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:462 errors:0 dropped:0 overruns:0 frame:0 TX packets:462 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:42110 (41.1 KiB) TX bytes:42110 (41.1 KiB)
So what about all of those settings and packet counts? Which should you look at and what do they tell you? Let’s run through them.
Encap – this one tells you about the encapsulation that is in use. The encap:Ethernet entry above just tells you that the interface is connected to an Ethernet and packetizes its communications for that standard.
HWaddr – the address that is associated with the physical network adaptor. The first portion (first three octets) can also be used to identify the manufacturer of your network adaptor. The value 78:2B:CB identifies the manufacturer of this network interface as Dell. You should be able to find a number of sites online to identify the manufacturer from this information. One such site is http://www.askapache.com/online-tools/mac-lookup/.
Sign up for Computerworld eNewsletters.