WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: /etc/udev/rules.d/70-network.rules has no effect  (Read 2273 times)

Offline lovelypp

  • Jr. Member
  • **
  • Posts: 51
/etc/udev/rules.d/70-network.rules has no effect
« on: September 21, 2020, 04:35:49 AM »
to rename nic, I put 70-network.rules to /etc/udev/rules.d/, the content is as following:
SUBSYSTEM=="net", ATTR{address}=="00:18:7D:CC:10:22", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="00:18:7D:CC:10:21", NAME="eth1"

then I add etc/udev/rules.d/70-network.rules to .filetool.lst and backup it.

after reboot, I found no it has no effect. I don't know what's wrong, thanks!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: /etc/udev/rules.d/70-network.rules has no effect
« Reply #1 on: September 21, 2020, 12:22:16 PM »
Backup happens late - the device has already been created. You may have to call udevadm trigger with specific options, or use one of the many ifrename tools.
The only barriers that can stop you are the ones you create yourself.

Offline lovelypp

  • Jr. Member
  • **
  • Posts: 51
Re: /etc/udev/rules.d/70-network.rules has no effect
« Reply #2 on: September 23, 2020, 09:53:44 PM »
thanks

Offline lovelypp

  • Jr. Member
  • **
  • Posts: 51
Re: /etc/udev/rules.d/70-network.rules has no effect
« Reply #3 on: September 26, 2020, 07:57:09 AM »
is there any method to bring the Backup resore step forward ?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: /etc/udev/rules.d/70-network.rules has no effect
« Reply #4 on: September 26, 2020, 08:34:01 AM »
Hi lovelypp
No there isn't. Restore is also used to restore configuration files supplied by extensions when they've been modified, so
it has to run after extensions have been loaded.

Is this of any help:
Hi halma
As is often the case there can be multiple ways of doing something under Linux. If you don't want to use  udev  you can try adding
this to your  /opt/bootsync.sh  file:
Code: [Select]
# Assign unused names to the network cards
nameif want_eth0 ab:cd:ef:12:34:56
nameif want_eth1 65:43:21:fe:dc:ba

# Assign the desired names to the network cards
nameif eth0 ab:cd:ef:12:34:56
nameif eth1 65:43:21:fe:dc:ba

If your  opt  directory is not persistent, run a backup and reboot. The  nameif  command is the  busybox  version of  renameif.

If you do try the  udev  way you probably need to ad this to your  /opt/bootsync.sh  file:
Code: [Select]
udevadm control --reload-rules
udevadm trigger