Linux View network card traffic six ways
This article introduced the Linux to see the network card traffic six methods, Linux system using Nload, Iftop, Iostat and other tools to view the network card traffic, the need for friends under the reference.
method One, nload tools
SOURCE Package Path:
Http://heanet.dl.sourceforge.net/project/nload/nload/0.7.2/nload-0.7.2.tar.gz
To view the Parameters help command:
Nload–help
-A: This seems to be the refresh time period for all data, in seconds, by default of 300.
-I: Enter the network card flow chart Display scale maximum setting, the default 10240 kbit/s.
-M: Do not display traffic graph, only statistics.
-O: Out of the network card flow chart Display scale maximum setting, default 10240 kbit/s.
-T: Displays data refresh interval, in milliseconds, default 500.
-U: Sets the data units for the right Curr, AVG, Min, Max, which is automatically changed by default. Note that the case unit is different.
H|b|k|m|g H:auto, b:bit/s, k:kbit/s, m:mbit/s etc.
h| b| k| m| G H:auto, b:byte/s, k:kbyte/s, m:mbyte/s etc.
-U: Sets the data unit for the right TTL, which is automatically changed by default. Note that the capitalization units are different (same as-u).
Devices: Custom monitoring of the network card, the default is all monitoring, using the left and right key switch.
If only monitor eth0 command: nload eth0
method Two, Iftop tool
SOURCE Package Path:
Http://www.ex-parrot.com/%7Epdw/iftop/download/iftop-0.17.tar.gz
1, Iftop interface related instructions
The interface shows a scale range similar to scale, which is used as a ruler for displaying the flow pattern.
The middle <= => these two left and right arrows, indicating the direction of the flow.
TX: Send Traffic
RX: Receive Traffic
Total: Gross flow
Cumm: Total flow of running iftop to current time
Peak: Peak Flow
Rates: The average traffic of the past 2s 10s 40s respectively
2, Iftop related parameters
Commonly used parameters
-I set the monitoring network card, such as: # Iftop-i eth1
-B displays traffic in bytes (bits by default), such as: # Iftop-b
-N Causes the host information to appear by default directly to the IP, such as: # Iftop-n
-N causes port information to be displayed directly by default, such as: # Iftop-n
-F shows incoming and outgoing traffic for a specific network segment, such as # iftop-f 10.10.1.0/24 or # iftop-f 10.10.1.0/255.255.255.0
-H (Display this message), Help, display parameter information
-P using this parameter, the middle of the list shows the local host information, the presence of IP information outside the machine;
-B to display the flow graph bar by default;
-F This is temporarily not very good to use, filtering the calculation package;
-P causes host information and port information to be displayed by default;
-M to set the maximum of the top of the interface, the scale is divided into five large segment display, example: # iftop-m 100M
Some action commands after entering the Iftop screen (note case)
Press H to toggle whether to show help;
Press N to toggle the display of the IP or host name of the computer;
Press S to toggle whether the local host information is displayed;
Press D to toggle whether to display host information for remote target hosts;
Press T to toggle the display format to 2 lines/1 lines/Show only send traffic/show only receive traffic;
Toggle the display port number or port service name by N;
Press S to toggle whether or not to display the port information of the machine;
Press D to toggle the display of port information for the remote target host;
Press p to toggle whether or not to display port information;
Press p to toggle suspend/continue display;
Whether the average flow graph bar is shown by B switch;
The average flow rate in 2 seconds or 10 seconds or 40 seconds is calculated by B switch;
Press T to toggle whether the total flow of each connection is displayed;
Press L to open screen filtering function, input to filter characters, such as IP, press ENTER, the screen will only display this IP-related traffic information;
Press L to toggle the display of the top of the screen, the scale is different, flow chart will change;
Press J or press K to scroll up or down the screen to display the connection record;
1 or 2 or 3 can be sorted according to the three-column flow data displayed on the right;
Press < sort according to the local name or IP on the left;
Press > To sort the host name or IP of the remote target host;
Press O to toggle to show only current connections;
Press F can edit the filter code, this is translated from the saying, I have not used this.
Press! You can use the shell command, this is useless. I don't know what order works here.
Press Q to exit monitoring.
Method III, Ifstat
SOURCE Package Path:
Http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz
Parameters:
-A monitors the status information of all network interfaces that can be detected
-Z Hidden traffic is an interface that is not available, for example those interfaces that started but were not used
-i specifies the interface to be monitored, followed by the network interface name
Time:
-T reports full bandwidth of all monitoring interfaces
-W automatically enlarges column widths with the specified column width rather than the length of the interface name
-W Wrap text automatically if the content is wider than the width of the terminal window
-B displays bandwidth rather than kbytes/s with kbits/s
method Four,
Iptraf
Installation method:
Yum-y Install Iptraf
methods Five,
Watch Ifconfig
method Six,
Watch Cat/proc/net/dev
Original address: http://www.jbxue.com/LINUXjishu/22228.html