Tcpdump: packet printing is not supported for link type CAN_SOCKETCAN: use -w

can0 is up and running, I still get this error:

tcpdump: packet printing is not supported for link type CAN_SOCKETCAN: use -w

Hello there @zara!

Would you mind providing a little more information on what the issue is? Are you trying to run tcpdump from a multi-container deployment, or a single container? What base image are you using to build your container?

Thank you very much!

Hi @xginn8,

that makes sense.

I am using a the resin/armv7hf-debian:latest image, and multi-container deployment, the other containers are using different kind of images, such as the the balena alpine images.

The container I am trying to do a tcpdump -i can0 is privileged and running in the host network. What I have also forgot to mention is, that other tcpdump for other (up and running) interfaces are working, e.g. tcpdump -i eth0.

Thanks for coming back to me,

Hi @zara,

If you are trying to dump traffic on the CAN interface, I think you want to use candump (provided as part of the can-utils package in Debian Stretch. Would you mind giving that a shot and letting us know the results?

Thank you!

Hi @xginn8,

candump is working fine, but this is only showing me the incoming traffic, as fare as I am aware I am supposed to see also what I am sending to the can bus with tcpdump, for which I was interested.

In the end of the day, I have found now another solution for my initial problem, thank you so much for your quick support!


Hi @zara,

Would you mind sharing the workaround so that others may benefit if they encounter the same issue? We are continuing to investigate why you are unable to use tcpdump here as well.

Thank you!

@xginn8 of course! I am sorry that I have not brought this up myself.

But let me first give you some context, we are running a multi container application in different environments (balena applications, test, integration, prod…), one service would speak to the can bus, currently we were looking for an ‘easy’ solution to run integration tests directly on a jetsontx2. I was looking for a way to write tests, which are ensuring that our service is sending the right messages, when being pocked from other services. tcpdump seemed like a possible solution, since this did not worked out, we are now going to deploy an additional service which will just respond via can, in case he received the right message.

Does that make sense? We have only started with this story, so there are still some steps a head, but that is our current plan.

Happy to have further discussions on this approach or to answer additional questions.

Thank you also for investigating the tcpdump issue.