1

I'm doing a BASH script for Arch Linux in a Raspberry Pi 2. The thing is that in some point I'd like to reload the network interfaces without reboot and have my new named network interfaces (en0 and wl0) when I insert networkctl, for instance. The solution I've found is:

Bring the network interfaces down:

ip link set <net_if> down ;

Modify /etc/udev/rules.d/70-persistent-net.rules (or its equivalent): in my case it is 10-network.rules. It contains:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:aa:aa:aa:aa:aa", NAME="en0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="bb:bb:bb:bb:bb:bb", NAME="wl0"

Reload with

udevadm control --reload-rules ;

Retrigger with

udevadm trigger --attr-match=subsystem=net ;

Bring the network interfaces up:

ip link set <net_if> up ;

But it didn't work on my RbPi2.

I've also found on another post that in some point you must insert

modprobe -r <driver module>

but I can't find my driver module for my wifi dongle (I've tried with lsusb -v).

BTW: I'm not using Networkmanager. I have configured the network interfaces with systemd (/etc/systemd/network/). I've also tried reloading the systemd-networkd service.

Thanks

  • I don't know Arch Linux. Do you have access to ifdown and ifup? – Cyrus Jul 30 '15 at 18:58
  • When you say "But it didn't work" do you mean that the network interface did not get renamed, or something else? – Celada Jul 30 '15 at 19:40
  • I don't know much about systemd configuration. I've tried to insert the ifdown command and Bash returns -bash: ifdown: command not found. To Celada: Yes, I want that after the network reload if I insert networkctl the shell shows the new network interfaces: en0 and wl0. – ctafur Jul 30 '15 at 20:05
0

to get the driver for a network interface, just use : ethtool -i en0 and look for the "driver" section :

root@odin ~ # ethtool -i eth0
driver: e1000e
version: 2.3.2-k
firmware-version: 0.13-4

Here, my driver is e1000e.

Now you can rmmod your driver and modprobe it again. This will also reset the network counters, of course.

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.