Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 4451  / 1 Year ago, tue, may 30, 2023, 10:59:11

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)?


More From » boot

 Answers
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

[#26329] Thursday, June 1, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allally

Total Points: 487
Total Questions: 106
Total Answers: 110

Location: Laos
Member since Sun, Jul 3, 2022
2 Years ago
;