Monitor upload traffic

Hello, is there a package or CLI that can monitor uploads?

I'd like to see what my IOT devices are uploading to the internet (time, destination, bytes).

Thank you.

here is some tools to monitor traffic.

iptraf-ng can also help.

Thanks,
When I look at conntrack, is there a field where it can show downloaded vs uploaded traffic?

Yes, the SRC and DST IPs.

I think he means bytes.

1 Like

I was wanting to know if conntrack can show me which is upload vs download traffic :slight_smile: an easy to tell.

connectd -L shows lines like
tcp 6 7439 ESTABLISHED src=172.16.254.254 dst=172.16.227.121 sport=53190 dport=22 packets=43 bytes=5289 src=172.16.227.121 dst=172.16.254.254 sport=22 dport=53190 packets=32 bytes=3910 [ASSURED] mark=256 use=1
So you can see, how many bytes in which direction, for active connection.
Either you write a smart script to evaluate this output (either periodically or using conntrack events), OR, you become familar with "ulogd" , to do accouting for longer periods of time.

2 Likes

whats the cli command? just connectd -L? I tried that and it didnt work.

Sorry, my fault. Try 'conntrack -L' instead.

I guess the hard part is, idk how to tell what is upload vs download from conntrack. Any helpful tips?
I tried to upload a file to google drive and capture the output from conntrack, but it doesnt make sense, I see multiple connections uploading to google.

src/dst indicates direction. Of course, there might be multiple connections used simultaneously.

When I look at my sample data I can see source and destination and then destination and source in the same line, but with data, so I'm a little confused. There's no indicator in the line that says which way it's going.

That's the hard part for me right now. I'm kind of looking for an indicator so I can only pick on that.

Always from src to dst. Usually, connections are used in both ways ...

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.