Go Back   TechArena Community > Software > Tips & Tweaks
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



netstat command in Linux

Tips & Tweaks


Reply
 
Thread Tools Search this Thread
  #1  
Old 14-09-2010
Member
 
Join Date: Jul 2010
Posts: 93
netstat command in Linux
  

Many of Linux users would be curious to know about the nestat command. The command "nestat" displays statistical information and the current state of network connections, protocols, ports / sockets and appliances. The following is the syntax :
netstat [options]
The following are the options :
  • -S displays statistical information about the protocols.
  • -I displays statistical information about the network interface.
  • -R displays the routing table.
  • -C displays statistical information and updates every second
  • -L displays information about all sockets that are ready to listen.
  • -A displays information about all sockets that are ready to listen and not listen.
  • -P displays information about sockets and PID with ProcessName.

Reply With Quote
  #2  
Old 14-09-2010
Member
 
Join Date: Jul 2010
Posts: 93
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.
Reply With Quote
  #3  
Old 14-09-2010
Member
 
Join Date: Jul 2010
Posts: 93
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].
Reply With Quote
  #4  
Old 14-09-2010
Member
 
Join Date: Jul 2010
Posts: 93
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
Reply With Quote
Reply

  TechArena Community > Software > Tips & Tweaks
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "netstat command in Linux"
Thread Thread Starter Forum Replies Last Post
Question about -F Linux Command Tynan Operating Systems 3 14-01-2011 03:32 AM
How to use linux dd command Rubeen Operating Systems 5 02-04-2010 10:59 AM
Linux history command and fc command Alkesh jain Operating Systems 3 26-05-2009 07:53 PM
Blue screen after "netstat" command Logan.M Operating Systems 3 14-02-2009 06:54 PM
Linux passwd command gvBlake Operating Systems 5 13-01-2009 09:32 AM


All times are GMT +5.5. The time now is 04:28 AM.