1

How would you go monitoring network traffic on a router using a raspberry pi.

I have looked at the questions

Network monitor by Process

and

Raspberry Pi as a network monitoring device

but they aren't really answering my questions. Does all the traffic need to be routed through the pi and then to the router to go out. Or is it possible to attach the pi to the router and have it collect data that way?

2 Answers 2

2

You don't need to route all traffic through the Raspberry, but I'd also not use a "dumb" hub, since a) these are hard to find nowadays and b) they multiply the traffic on your network.

There are managed Ethernet switches which can forward all traffic to a monitoring port and the Raspberry can then capture the traffic on the monitoring port. At the same time, the switch will still forward the packets on the correct port, so it'll have less impact on the network than routing everything through the Raspberry.

I have good experiences with a HP-1810G (Gigabit), monitoring with my laptop. It is at ~80 € for the 8 port version. For the Raspberry, you could use a Gigabit USB network adapter (which will be faster than 100 MBit) or just decide for a cheaper 100 MBit version of the switch.

1

Not sure if this will solve your problem but generally speaking:

Smart routers nowadays do not echo all the traffic to all the ports if its not distend to go there. Running a monitoring software as for instance tcpdump will only show data on the same physical wire as the pi. If you put an old stupid hub in the center of your network it will echo all the packages to the same segment as the rpi and it will be able to pick up it all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.