46 lines
817 B
Markdown
46 lines
817 B
Markdown
<a href="../../../Readme.md">
|
|
<img src="../../../common/back_arrow.png" alt="50" width="50"/>
|
|
</a>
|
|
|
|
# MISC - Socket CAN Linux
|
|
|
|
## Connect interface
|
|
|
|
Physical CAN:
|
|
```console
|
|
sudo ip link set can0 up type can bitrate 500000
|
|
```
|
|
|
|
Virtual CAN:
|
|
```console
|
|
sudo ip link set vcan0 up type vcan
|
|
```
|
|
|
|
## View and record dump
|
|
|
|
View:
|
|
```console
|
|
candump can0
|
|
```
|
|
|
|
Record:
|
|
```console
|
|
candump -l can0
|
|
```
|
|
|
|
|
|
## Replay dump
|
|
|
|
Assume to replay a file recored on can0 on vcan0:
|
|
```console
|
|
canplayer vcan0=can0 -I candump-2024-06-13_150626.log
|
|
```
|
|
|
|
To replay an infinite number of times:
|
|
```console
|
|
canplayer vcan0=can0 -I candump-2024-06-13_150626.log -l -i
|
|
```
|
|
|
|
|
|
## References
|
|
- [CAR Hacking 101](https://medium.com/@yogeshojha/car-hacking-101-practical-guide-to-exploiting-can-bus-using-instrument-cluster-simulator-part-ee998570758) |