Your question is confusing to me. You do not explain what you mean by the CAN link
- is this a Controller Area Network? If so, why are you provisioning an IP address for it? Did you get the "script" in your question from a tutorial or manufacturer's instructions? If so, you should supply a link (edit your question).
Assuming you're following competent instructions, and you do actually need to provision an IP address for this CAN link
, please read on as you have apparently made one or more of the errors below. Otherwise please edit your question to explain your use case & we'll try to help.
Your question says you have edited the file /etc/network/interface
, but this file does not exist in a default RPi OS image. You may have this confused with the file: /etc/network/interfaces
(note the 's') which is included in default RPi OS images.
The file /etc/network/interfaces
contains the following line:
# Please note that this file is written to be used with dhcpcd.
Which is an awkward way of saying that you are not supposed to manually edit this file if you use the default network management tool dhcpcd
. Instead, you should use /etc/dhcpcd.conf
, and follow the syntax defined in man dhcpcd.conf
to declare your interface.
- You may be using the incorrect Network Manager. If
/etc/network/interfaces
is to be used as you've shown in your question, you will need to disable dhcpcd
, and install or use another network manager; e.g. network-manager
, systemd-networkd
.
sudo
is never just run without at least ONE argument - what exactly is the command you are running - also, can you see any errors indmesg
that may indicate why the pi is taking longer to boot?/etc/network/interface
and this has caused network failure and breakssudo
? You did nothing else?cmdline.txt
file, addinginit=/bin/bash
to the end of the single line in that file - then put it back in your pi, boot, and issue the commandmount -o remount,rw / –target /
- now you can edit that file that's causing the problem, remove theinit=/bin/bash
fromcmdline.txt
and reboot - at least you'll now be back to a functional pi/etc/network/interface
(unless you disable interface indhcpcd
)