Linux is supporting virtual can interface. it was enabled by:
modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ifconfig vcan0 up
While using cam-utils
such as camsniffer
and cansend
cansend vcan0 321#1212
cansniffer vcan0
I could able to see can packets; but only within same host. I tried Ubuntu VirtualBox machine. Both guest and host OS are interconnected using host-only adapter vboxnet0
.
Also tried SocketCAN socket(PF_CAN, SOCK_RAW, CAN_RAW)
but not able to receive on other machine(works within same machine) While trying with broadcast manager socket(PF_CAN, SOCK_DGRAM, CAN_BCM)
on executing stderr
says `operation not supported
Simply, could one send and receive CAN packets between Linux hosts? Doesn't matter its Virtual Machine (vboxnet0) or physically connected (Ethernet).
Note: I used Ubuntu 16.04 and 12.04 as Host and Guest OS respectively.