How to automatically bring up CAN interface in Ubuntu 17.10
By Joseph Russell •
In previous versions of Ubuntu I have been using this script to automatically bring up an network interface for a USB to CAN bridge device, whenever the device is plugged in:
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
allow-hotplug can0
iface can0 can static bitrate 250000 up /sbin/ip link set $IFACE down up /sbin/ifconfig $IFACE txqueuelen 20000 up /sbin/ip link set $IFACE type can bitrate 250000 restart-ms 10 up /sbin/ip link set $IFACE upThis script does not work any more because Ubuntu 17.10 is not using ifupdown and consequently /etc/network/interfaces file is no longer used. My question is, how do I rewrite this script using the new netplan configuration system?
In particular, what is critical for functioning of my script above is the line allow-hotplug can0 which detects when the can0 interface becomes available (shortly after plugging the device into USB port). Can I do this using the new configuration system?
Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"