Network Services

Saturday, April 26, 2014

Using the ifconfig Utility



Using the ifconfig Utility
There is a utility in Linux/UNIX that shows information similar to what ipconfig shows. This utilityis called ifconfig (short for “interface configuration”). Although ipconfig and ifconfig show similar information, there are major differences between these two utilities. The ipconfig utility is used mainly to view TCP/IP configuration for a computer. You can use ifconfig to do the
same thing, but ifconfig can also be used to configure a protocol or a particular network interface. The general syntax of the ifconfig command is as follows:

ifconfig interface [address [parameters]]

The interface parameter is the UNIX name of the interface, such as eth0. If the optional address parameter is specified, the ifconfig command sets the IP address for the interface to
the address specified. When the ifconfig command is used by itself with no parameters, all configured interfaces are reported on. If only the interface name is specified, output similar to
the following is produced:



The output shows that the eth0 interface is a 10Mbps Ethernet interface. The interface’s MAC and IP address information is displayed in this output as well. The third line of the output begins
by listing the state of the various flags an interface can have. The optional parameters field at the end of the ifconfig command can be used to change the state of these flags. The MTU and metric fields are used in making routing decisions, just as they would be used in any router. The values on the RX (receive) and TX (transmit) lines represent, in order, the number of packets that were transmitted or received without errors, how many packets were transmitted or
received with errors, how many packets were dropped due to insufficient buffer space, and how many packets were lost due to the packets overrunning the capacity of the kernel to process
them. Often the receive value will be higher than the transmit value for these last two properties because transmitted packets can be controlled much more easily than inbound packets.

0 comments:

Post a Comment