I have a USB CAN module connected to a Pi4 running bookworm. When I manually issue the commands below.
The interface comes up and I can receive packets without issues. So now the question becomes, how do I issue those commands at startup?
I've searched the forums and Google but keep coming up with contradicting answers.
Some people say they got it working using /etc/network/interfaces but later comments state not to use that file as it can affect other interfaces.
Some people state to use /etc/rc.local but the file needs to be created and comments state that rc.local is on its way out and you should use something else.
I also tried using systemd-networkd and after creating the file inside /etc/systemc/network the interface did not come up at boot up.
So I'm a bit confused as to how to proceed here, any help would be greatly appreciated.
Code:
sudo ip link set can0 downsudo ip link set can0 type can bitrate 250000sudo ip link set can0 upI've searched the forums and Google but keep coming up with contradicting answers.
Some people say they got it working using /etc/network/interfaces but later comments state not to use that file as it can affect other interfaces.
Some people state to use /etc/rc.local but the file needs to be created and comments state that rc.local is on its way out and you should use something else.
I also tried using systemd-networkd and after creating the file inside /etc/systemc/network the interface did not come up at boot up.
So I'm a bit confused as to how to proceed here, any help would be greatly appreciated.
Statistics: Posted by L-P-G-2 — Sun Apr 13, 2025 1:41 pm