netstat -antl
For TCP ports, and:
netstat -aunl
For UDP ports. Similarly we can also use lsof, (list open files), these sockets are feally open files:
lsof -i
And we can select IPv4 only with
lsof -i 4
And IPv6 with
lsof -i 6
The command iptables is often associated with firewalls but even without any firewall rules in place we can use iptables as the root use to display how much traffic visits the machine as well as using it to display traffic that meets firewall rules when set, simple use:
iptables -nvL INPUT
You can reset counters with :
iptables -Z
Back with netsat we can use
netstat -i
To display receive and transmit data on a per interface basis. We also see errors here that can be useful in diagnosing faulty network hardware. The final command we look at is:
netstat -s
To display per protocol statics and how much has be sent and received.
0 comments:
Post a Comment