[opensuse] Disableing persistent NIC names
Hi, I have a case where I want to disable the persistence of NIC names. Actually I have a SuseStudio appliance that has to be used on different PC's. Every time I put the USB-stick in another PC there is another NIC name (ethx), and it's unconfigured. I would like to have always eth0, using the configuration of eth0. I found it has something to do with /etc/udev/rules.d/70.persistent-net.rules. Every NIC used has it's entry there. What is writing those rules ? Can it be disabled ? Other solutions ? Maybe erasing this file on shutdown, or maybe better on startup ? Thanks for any info. -- Met vriendelijke groeten, Koenraad Lelong
Koenraad Lelong wrote:
Hi, I have a case where I want to disable the persistence of NIC names. Actually I have a SuseStudio appliance that has to be used on different PC's. Every time I put the USB-stick in another PC there is another NIC name (ethx), and it's unconfigured. I would like to have always eth0, using the configuration of eth0. I found it has something to do with /etc/udev/rules.d/70.persistent-net.rules. Every NIC used has it's entry there. What is writing those rules ? Can it be disabled ?
You can just delete those lines, and they'll be auto-generated each time. /Per -- Per Jessen, Zürich (21.6°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen schreef:
Koenraad Lelong wrote:
Hi, I have a case where I want to disable the persistence of NIC names. Actually I have a SuseStudio appliance that has to be used on different PC's. Every time I put the USB-stick in another PC there is another NIC name (ethx), and it's unconfigured. I would like to have always eth0, using the configuration of eth0. I found it has something to do with /etc/udev/rules.d/70.persistent-net.rules. Every NIC used has it's entry there. What is writing those rules ? Can it be disabled ?
You can just delete those lines, and they'll be auto-generated each time.
/Per
Hi Per, Thanks for the suggestion, but that's not a real solution. The whole point of the stick is that an "innocent" user can plug it in, boot and "use" the appliance. I found out I can't use a live-cd because the ftp-server the appliance contains needs to be able to download files. But it seems a valid assumption that removing the file (or making it empty) will work. Now finding out when and how to do this. -- Met vriendelijke groeten, Koenraad Lelong
Koenraad Lelong wrote:
Per Jessen schreef:
Koenraad Lelong wrote:
Hi, I have a case where I want to disable the persistence of NIC names. Actually I have a SuseStudio appliance that has to be used on different PC's. Every time I put the USB-stick in another PC there is another NIC name (ethx), and it's unconfigured. I would like to have always eth0, using the configuration of eth0. I found it has something to do with /etc/udev/rules.d/70.persistent-net.rules. Every NIC used has it's entry there. What is writing those rules ? Can it be disabled ?
You can just delete those lines, and they'll be auto-generated each time.
/Per
Hi Per, Thanks for the suggestion, but that's not a real solution. The whole point of the stick is that an "innocent" user can plug it in, boot and "use" the appliance. I found out I can't use a live-cd because the ftp-server the appliance contains needs to be able to download files. But it seems a valid assumption that removing the file (or making it empty) will work.
Koenraad, I haven't thought it all through, but as long as you have a properly configured /etc/sysconfig/network/ifcfg-eth0 file, and your /etc/udev/rules.d/70.persistent-net.rules is empty, I really think it's a real solution. On boot up, your system will assign 'eth0' to the only NIC and isn't that what you want?
Now finding out when and how to do this.
I think I would add "dd if=/dev/null of=<persistentnet-rulefile>" somewhere in /etc/init.d/boot* /Per -- Per Jessen, Zürich (21.8°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
Koenraad, I haven't thought it all through, but as long as you have a properly configured /etc/sysconfig/network/ifcfg-eth0 file, and your /etc/udev/rules.d/70.persistent-net.rules is empty, I really think it's a real solution.
Okay, a better solution is perhaps to look at "75-persistent-net-generator.rules" - I haven't done so, but it seems to be the place that governs when/how persistent network device names are allocated. Maybe it would suffice to remove 'eth*' from the device name whitelist? /Per -- Per Jessen, Zürich (22.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
Okay, a better solution is perhaps to look at "75-persistent-net-generator.rules" -
:-) indeed
I haven't done so, but it seems to be the place that governs when/how persistent network device names are allocated. Maybe it would suffice to remove 'eth*' from the device name whitelist?
Or just disable the writing of the 70-persistent-net.rules entry, which is done in the line DRIVERS=="?*", IMPORT{program}="write_net_rules" So I'd try just commenting that one out... Pit -- Dr. Peter "Pit" Suetterlin http://www.astro.su.se/~pit Institute for Solar Physics Tel.: +34 922 405 590 (Spain) P.Suetterlin@royac.iac.es +46 8 5537 8534 (Sweden) Peter.Suetterlin@astro.su.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Koenraad Lelong
-
Per Jessen
-
Pit Suetterlin