Overview
To avoid bringing up the can interface every time we reboot or plug in the cable, we can use the following setting to automate the process.
Normally, we will need this command to bring up the interface and set the bitrate.
sudo ip link set can0 up type can bitrate 1000000
Now we want to set a configuration file once and be able to use the interface when the cable is plugged in.
Steps
Add a new file: /etc/systemd/network/99-interbotix.network
.
Put in the following lines.
[Match]
Name=can0
[CAN]
BitRate=1000000
Reboot the machine.
Result
Now can0
should be up when we plug in the cable. And we’ll get no such device error when it’s unplugged.