0

When the sudo command is typed and pressed on the terminal, it's getting hanged. Background: I tried to establish the CAN link on the Raspberry PI board. Added CAN link connection command/script upon boot-up. For that, in /etc/network/interface I added the script below:

auto can0
  iface can0 inet manual
  pre-up /sbin/ip link set can0 type can bitrate 1000000
  up /sbin/ifconfig can0 up
  down /sbin/ifconfig can0 down

After this everything is not working. When I reboot the RPi board, it takes serveral minutes to boot up and the wifi doesn't work. Terminal works but stucks after sudo command. Please help!

Note: Any command run with sudo doesn't work, for example sudo nano <file>.

Gabboxl
  • 169
  • 13

1 Answers1

1

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.

  1. 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.

  2. 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.

  1. 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.
Seamus
  • 23,558
  • 5
  • 42
  • 83