&http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP; The Ifconfig command makes the Linux core aware of some network interfaces such as software loopback and Nic so that Linux can use them. In addition to the usage described above, the ifconfig command is used to monitor and change the state of the network interface, and can also carry many command-line arguments. The following is a generic invocation syntax for ifconfig:
#ifconfig interface [[-net|-host] address [parameters]]
Where interface is the name of the network interface: address is the host name or IP addresses assigned to the specified interface. The host names used here are parsed into their peer IP addresses, and this parameter is required. The-net and-host parameters tell Ifconfig to use this address as a network number or as a host address, respectively.
If you call the Ifconfig command with only the upper port device name, it displays the configuration of the port, and if you do not take any arguments, the ifconfig command displays all the information of the interface configured so far, and if you take the-a option, you can also display the currently inactive interface.
A ifconfig call that checks the Ethernet interface eth0 can get the following output:
#ifconfig eth0
Eth0 Link encap 10Mbps Ethernet hwaddr 00:00:c0:90:b3:44
inet addr xxx.xxx.xxx.xxx bcast xxx.xxx.xxx.255 Mask
Up broadcast RUNNING MTU 1500 Metric 0
RX Packets 3136 Errors 217 dropped 7 overrun 26
TX packets 1752 Errors dropped 0 overrun 0
(Note: Where XXX.XXX.XXX.XXX is an IP address)
The MTU and Metric columns show the maximum data transfer values and interface measures for the current eth0 interface. An interface measure represents the cost of sending a group on this path. Routing is not currently used in the kernel, but may be used later. RX (Receive group number) and TX (Transfer group number) These two lines show receive, the number of transfer groupings, as well as the number of group errors, the number of missing groups (one likely due to less memory), and the number of limits (usually occurs when the receiver receives data faster than the core processing speed).
Parameters represents the various parameters supported by the ifconfig, which makes it easy to monitor and change the state of the network interface.