![]() |
| Linux Netstat (image: yourownlinux.com) |
Netstat (Network Statistic) is command line utility which used for monitoring both incoming and outgoing network connections, routing tables, interface statistic etc. Netstat can be used to print all the connected TCP and UDP socket connections and listening socket too while waiting for incoming connections.
Netstat available on MAC, Linux and Windows etc. But i using Slackware Linux for day activies, like my post previously about "Monitoring tools on Linux for Security". Yeah this tools can be used for system administrator for monitoring traffice network performance and troubleshoot related-network problems.
This tutorial for using linux netstat command line, so familiarize command line interface. LOL
List All TCP and UDP Connections
This netcat command for show list all TCP and UDP connections, simply run netstat command with "-a" option.
![]() |
| Output netstat -a (image: arief-jr.blogspot.com) |
List Only TCP Connection
For list only TCP connection, simply run command netstat with -at option. Option "t" is for show all list TCP connection not UDP connection.
![]() |
| Output netstat -at (image: arief-jr.blogspot.com) |
List Only UDP Connection
Netstat command can use for list only UDP connection, so simply run command netstat with "-au" options. Option "u" is for show all list UDP,
![]() |
| Output netstat -au (image: arief-jr.blogspot.com) |
List All Listening Connection
This netstat command for show all list listening connection, simply run netstat command with "-l" option.
![]() |
| Output netstat -l (image: arief-jr.blogspot.com) |
Disable Reverse DNS Lookup For Faster Output
By default, the netstat command tries to find the hostname of each IP address in the connection by doing a reverse DNS lookup. This slows down the output. Simply run netstat command using "-n" option for disable reverse DNS lookup.
![]() |
| Output netstat -n (image: arief-jr.blogspot.com) |
List The Process Name And User ID
When viewing the open listening ports and connections, it’s necessary to know the process name which has opened that port or connection. Simply run netstat command using "-nlpt" option.
![]() |
| Output netstat -nlpt (image: arief-jr.blogspot.com) |
For get username along with process, simply run netstat command using "e" option.
![]() |
| Output netstat -ltpe (image: arief-jr.blogspot.com) |
List Network Statistic
The netstat command can also be used to print network statistics of the total number of packets received and transmitted by protocol type. Simply run "netstat -s" for list network statistic.
![]() |
| Output netstat -s (image: arief-jr.blogspot.com) |
Displaying Ipv4 and Ipv6 Information
Displaying Ipv4 and Ipv6 information with netstat command, simply run "netstat -g" for show information both Ipv4 and Ipv6.
![]() |
| Output netstat -g (image: arief-jr.blogspot.com) |
Display Network Interfaces Statistic
Netstat command also can show interface statistic, as system administrator will surely require. Simply for show network interface statistic using netstat command type command "netstat -ie".
![]() |
| Output netstat -ie (image: arief-jr.blogspot.com) |
Conclusion
This post just share to learn using netstat command line in linux, so it's just learning network use linux. This netstat command for information for use as SysAdmin and not for hacked tutorial. If less clear can ask to me with follow google+ account or my official twitter or also read netsta manual.











Tidak ada komentar:
Posting Komentar