Saturday, May 11, 2013

Netstat

Netstat (network statistics) is a command-line tool that displays network connections, routing tables, and a number of network interface, and network protocol statistics.
Netstat is available on Unix-like operating systems (linux, osx, bsd and others) and on Windows.
With options -i we can see the interface (eth0, wlan0, tun0 and so on) table : netstat -i
Instead with -r we can see the route table : netstat -r
With -s we can see the networking statistics : netstat -s:
ex :
Ip:
278821 total packets received
6 with invalid addresses
0 forwarded
0 incoming packets discarded
278815 incoming packets delivered
260870 requests sent out
248 outgoing packets dropped
2250 dropped because of missing route
You can also see Icmp, UDP, TCP ecc..
--numeric : don't resolve names
--numeric-hosts : don't resolve host names
--numeric-ports : don't resolve port names
--numeric-users : don't resolve user names
With -p we can display display PID/Program name for sockets : netstat -p
-l : see listening server socket : netstat -l
ex :
unix 2 [ ACC ] STREAM LISTENING 7053 @/tmp/dbus-xW2uFsRBZo
Instead -a to see all server socket.

For more informations type netstat -h

If you have any problem or you need some explanations just write under this post!

1 comment: