LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slack 13.1 : /etc/udev/rules.d70-persistent-net.rules (https://www.linuxquestions.org/questions/slackware-14/slack-13-1-etc-udev-rules-d70-persistent-net-rules-863321/)

Ramurd 02-17-2011 08:38 AM

Slack 13.1 : /etc/udev/rules.d70-persistent-net.rules
 
I am kind of curious, in /etc/udev/rules.d/ is a file 70-persistent-net.rules where eth0 is being renamed to eth1

Is there any good, sane reason to do so? I know for a fact that Skype used to choke on this in the past (prior to the current version) and the installation generates settings for eth0, which will not exist, since this eth1 rule is created.

I usually rename the eth1 to eth0 (should actually delete this file) and reboot to fix this, but it's actually soemthing that has made me wonder since Slackware 13.0 (this is where this rule first showed up, and now that I installed a virtual machine I -once again- stumbled on this behaviour.)

allend 02-17-2011 08:55 AM

In your case you can edit the file so that your interface is assigned to eth0.

This rule file is useful if you have more than one interface in your computer. It guarantees that each interface card is assigned the same device name on reboot.
Otherwise it causes merry havoc if you reboot your machine and find that your interfaces have been reassigned. (e.g. your external interface that gets an IP by DHCP is now assigned an internal static IP address, Samba shares are lost, port forwards are lost)

Ramurd 02-17-2011 09:12 AM

I do actually do what you describe, but hadn't thought of the situation where your various interfaces may become available in a different order; Good point.

Then again: is there any reason why the interface count starts at eth1 instead of the expected eth0?

Martinezio 02-17-2011 09:18 AM

Do You have changed Your networking device after Slack installation?

GazL 02-17-2011 09:21 AM

It starts at 0 on mine.
Code:

PCI device 0x8086:0x10c0 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


Ramurd 02-17-2011 09:59 AM

Quote:

Do You have changed Your networking device after Slack installation?
Nope, it's the same device that I used during installation and was equally visible at install-time etc.

Quote:

It starts at 0 on mine.
Mine does read like that as well, but only after I edited the the persistent-net rules.

I'm not new, so the technical solutions are not my issue; The question I have is about the why it starts listing at eth1; that and it being the only network device I have put on this machine. I realize such rules are indeed practical as allend stated, I had skipped the possibility of having multiple ethernet cards.

If I put in a different ethernet card (different MAC), I would assume that both devices would be listed in this file, unless there is some hidden process that secretly edits this file :-) This (virtual) machine is not the first time I encountered this behaviour, I never bothered much about it, as I would just go and edit the rule. The first time I noticed this was back in the days that I had upgraded to Slackware 13.0 and tried to run Skype, which -back then- could not cope with the absense of eth0. It's an eternity ago, so I don't have all facts straight about it, but I reckon that my /etc/rc.d/rc.inet1.conf had both eth0 and eth1 enabled for dhcp, so that I did have network on the machine; Again: it's from a long time ago for my memory to recall such things... :-o

Anyway, I encountered it again today and I thought I'd ask about the reasons, if anyone knows.

rouvas 02-18-2011 05:55 AM

Pretty annoying stuff.
I got rid of it with

Code:

exit 0
on the start of /lib/udev/write_net_rules

At least on Slackware.12.2.

mlangdn 02-18-2011 07:08 AM

Mine starts at "eth0" also. I have never edited or deleted this file.

fskmh 02-18-2011 09:47 AM

Quote:

Originally Posted by Ramurd (Post 4261594)
I do actually do what you describe, but hadn't thought of the situation where your various interfaces may become available in a different order; Good point.

Then again: is there any reason why the interface count starts at eth1 instead of the expected eth0?

Many server and high-end motherboards come with two onboard GbE devices, so having a setting like this that survives a reboot is eminently sensible.

I do a fair amount of image deployment using clonezilla and I usually take care to delete this file before creating the image, otherwise the newly detected ethernet device gets added as eth1. Bottom line, just delete the file and reboot or restart udev and your device will go back to eth0.

fskmh 02-18-2011 09:52 AM

While we're on the subject, I don't know how many of you have seen this article:

Almost like freebsd's network-device naming scheme, but not quite. Can't say I'm looking forward to it :-/.

the_penguinator 02-18-2011 09:56 AM

Quote:

Originally Posted by Ramurd (Post 4261647)
Anyway, I encountered it again today and I thought I'd ask about the reasons, if anyone knows.

I don't have an answer, just similar experience. I have 28 laptops running 13, 13.1 and some current, in my class for my students. The Dell D600's in particular have occasionally booted with the interfaces renamed/swapped in the file you're speaking of. I don't think I have a definitive answer as to why. Sometimes the kids inadvertently hit Fn +F2 which shuts off the wireless card, other times who knows...generally a reboot sorts things out.


All times are GMT -5. The time now is 10:27 PM.