Network Administration: Linux Network Configuration Display

Linux doesn’t have an ipconfig command like Windows. Instead, the command that you use to display information about your network configuration is ifconfig. You can also use this command to set network configuration options, but in most cases, using the Network Configuration program or directly editing the network configuration files is easier.

If you enter ifconfig without any parameters, you get output similar to the following:

Eth0      Link encap:Ethernet  HWaddr 00:40:05:80:51:F3  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17293 errors:0 dropped:0 overruns:0 frame:0
          TX packets:334 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:1124153 (1.0 Mb)  TX bytes:45726 (44.6 Kb)
          Interrupt:3 Base address:0xc000 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:202939 errors:0 dropped:0 overruns:0 frame:0
          TX packets:202939 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13856758 (13.2 Mb)  TX bytes:13856758 (13.2 Mb)

From this output, you can tell that the IP address of the Ethernet adapter (eth0) is 192.168.1.200, the broadcast address is 192.168.1.255, and the netmask is 255.255.255.0. You can also see transmit and receive statistics as well as information about the hardware configuration, such as the MAC address and the adapter’s interrupt and memory base address assignments.