1

I have a couple of machines that use socketcan for CAN interfaces.

The hardware driver is loaded by modprobe pcan, and that module is currently magically configured to start itself on boot, which is working fine.

But every time I reboot, I have to bring up the network interfaces manually, e.g.:

sudo ip link set can0 up
sudo ip link set can1 up
sudo ip link set can2 up
sudo ip link set can3 up

What is the best way to bring up the canX interfaces on boot (and also making sure that they don't come up until the pcan module is loaded)?

  • Sorry about the poor tags, I was at a loss. – Jason C Mar 26 '14 at 18:53
2

I'm pretty sure you can just throw them into your rc.local file

sudo nano /etc/rc.local

#!/bin/sh -e

sudo ip link set can0 up
sudo ip link set can1 up
sudo ip link set can2 up
sudo ip link set can3 up

exit 0
| improve this answer | |
  • I ended up doing this with the addition of a few commands to load and initialize the module first. Maybe I should learn how to set up upstart jobs, though, it seems more appropriate (I guess, although this works perfectly fine). Thanks! – Jason C May 27 '14 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.