Re: netstat command in Linux
EXAMPLE :
For statistics about network connections:
netstat
The sample output from above:
Active Internet connections (w / o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 vhost: 32,803 LocalHost: smtp TIME_WAIT
tcp 0 0 vhost: 32,803 google.com http ESTABLISHED
Where,
- Proto - Specifies the protocol used for the connection.
- Recv-Q - Specifies the number of bytes that are not received.
- Send-Q - Specifies the number of bytes not sent to destination.
- Local Address - Specifies the local address or source port.
- Foreign Address - Specifies the destination address and port.
- State - Specifies the current state of the socket connection.
- ESTABLISHED - Connection is Established.
- TIME_WAIT - Waiting to Receive packets.
- LISTEN - Listening to Establish connection.
Re: netstat command in Linux
For the statistics of protocols:
netstat-s
The sample output from above:
- IP
5193 incoming packets Delivered
4813 requĂȘtes feels out - Tcp:
Received 4033 segments
4813 segments send out - Icmp:
41 ICMP Message Received
178 ICMP messages feels
For statistics of the network interface:
netstat-i
The sample output from above:
Kernel Interface table
Iface MTU Met RX-OK RX-ERR TX-OK TX-ERR Flg
eth0 1500 0 1308 0 1345 0 BMRU
This is statistical information for the Ethernet card [eth0].
Re: netstat command in Linux
DESCRIPTION :
You can see the status of network connections by listing the sockets open. This is the default option: if you do not specify address family, active sockets of all families address will be displayed. With the parameter-e you get some additional information (userid). With the parameter-v you can ask netstat report address families known not supported by the kernel. The-o parameter displays additional information on network timers. By giving -p you will see the PID and process name that owns socket. The-a displays all sockets, including listening socket servers. The address family inet displays Raw sockets, udp and tcp.
FILES :
- / Etc / services - The service mapping file
- / Proc / net / dev - Device information
- / Proc / net / raw - RAW socket information
- / Proc / net / tcp - TCP socket information
- / Proc / net / udp - UDP socket information
- / Proc / net / igmp - IGMP multicast information
- / Proc / net / unix - Unix domain socket information
- / Proc / net / ipx - IPX socket information
- / Proc/net/ax25 - AX25 socket information
- / Proc / net / appeltalk - information sockets DDP (appeltalk)
- / Proc / net / nr - NET socket information / ROM
- / Proc / net / route - Kernel IP routing information
- / Proc/net/ax25_route - AX25 routing information from kernel
- / Proc / net / ipx_route - IPX routing information from kernel
- / Proc / net / nr_nodes - routing information NET / ROM kernel
- / Proc / net / nr_neigh - Neighbourhood NET / ROM kernel
- / Proc / net / ip_masquerade - Connecting with masquerade kernel