LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Monitoring Packets Over an Open Port (https://www.linuxquestions.org/questions/linux-networking-3/monitoring-packets-over-an-open-port-910007/)

militiaware 10-25-2011 04:42 AM

Monitoring Packets Over an Open Port
 
I want to create a shell script that shows the size of transmitted data (sent and received) over a specific port! How is that possible?

eSelix 10-25-2011 07:19 AM

You can use iptables for this, something like:
Code:

iptables -N tcp_s80
iptables -A OUTPUT -p tcp --sport 80 -j tcp_s80
#and to read data (how many bytes/packets went by your port 80)
iptables -L -v

but every port need own rule, so it can slow down your network if you want to trace many ports. Other method is using "ntop" daemon.


All times are GMT -5. The time now is 09:06 AM.