LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-22-2012, 01:03 AM   #1
kankan55
Member
 
Registered: Nov 2012
Posts: 32

Rep: Reputation: Disabled
How to disable /lib/udev/write_net_rules


Hi Everyone,

How to disable /lib/udev/write_net_rules. This scripts always append unwanted rule I've edited the file /etc/udev/rule.d/70-persistent-net.rules

Here is what it want

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:02:04.0", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:02:05.0", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:03:05.0", KERNEL=="eth*", NAME="eth2"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:03:05.1", KERNEL=="eth*", NAME="eth3"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:0e:00.0", KERNEL=="eth*", NAME="eth4"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:11:00.0", KERNEL=="eth*", NAME="eth5"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:0b:05.0", KERNEL=="eth*", NAME="eth6"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ID=="0000:0b:05.1", KERNEL=="eth*", NAME="eth7"

But when the NIC module is loaded again , the unwanted line append to the file like below.

# PCI device 0x14e4:0x16a8 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:5e:a8:4c:6f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x14e4:0x16aa (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:bd:13:86", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"

# PCI device 0x14e4:0x16ac (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:5e:6e:b7:c8", ATTR{type}=="1", KERNEL=="eth*", NAME="eth6"

# PCI device 0x14e4:0x16ac (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:5e:6e:b7:ca", ATTR{type}=="1", KERNEL=="eth*", NAME="eth7"

# PCI device 0x14e4:0x16a8 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:5e:a8:4c:6e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x14e4:0x16aa (bnx2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:be:13:02", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"

# PCI device 0x14e4:0x16a8 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:5e:a8:4c:72", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x14e4:0x16a8 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:5e:a8:4c:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

So, How can I disable /lib/udev/write_net_rules that ruin my config.

Thank you
 
Old 11-22-2012, 11:13 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
Quote:
So, How can I disable /lib/udev/write_net_rules that ruin my config.
Try if this works:

In your /etc/udev/rules.d/70-persistent-net.rules modify the entry KERNEL=="eth*", NAME="eth0" into--

Code:
NAME:="eth0"
That is: remove the KERNEL=="eth*" glob entry; and modify the NAME=key assignment from '=' into ':=' as it is shown above, then reload the udev rules

Code:
~# udevadm control --reload
Hope that helps.

Good luck.

Last edited by malekmustaq; 11-22-2012 at 11:16 AM.
 
Old 11-24-2016, 12:02 PM   #3
andrewufrank
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Thumbs up this is brilliant - and works !

Quote:
Originally Posted by malekmustaq View Post
Try if this works:

In your /etc/udev/rules.d/70-persistent-net.rules modify the entry KERNEL=="eth*", NAME="eth0" into--

Code:
NAME:="eth0"
That is: remove the KERNEL=="eth*" glob entry; and modify the NAME=key assignment from '=' into ':=' as it is shown above, then reload the udev rules

Code:
~# udevadm control --reload
Hope that helps.

Good luck.
this is brilliant and helps with the udev rules for which many cannot understand the justification. in a raspberry pi the MAC is in the hardware and moving a working SD card from one box to another is not working: the udev rules see the new MAC address and fail to connect to it. the same with uboot booting systems - the MAC is then usually in the code that boots but the rest of the system is stored on some disk - again, no internet connection.

could you explain why and how it works?

thank you !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] eeepc error when booting up lib udev bert539 Linux - Laptop and Netbook 9 12-21-2010 07:09 AM
[SOLVED] How can I disable or configure udev for initrd? Erik_FL Slackware 1 11-08-2010 10:29 PM
[SOLVED] /lib/udev/usb_id startup errors page_seven Linux - Software 1 10-26-2010 04:31 AM
How do I disable a device that was enabled in udev? Woodsman Slackware 5 03-29-2008 09:03 PM
Can I disable rc.udev with 2.4 kernel shepper Slackware 2 09-18-2005 09:45 PM


All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration