LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   After switching computers, eth0 became eth1 and then eth2 (http://www.linuxquestions.org/questions/slackware-14/after-switching-computers-eth0-became-eth1-and-then-eth2-4175477001/)

lems 09-13-2013 10:25 AM

After switching computers, eth0 became eth1 and then eth2
 
Hello,

when my desktop PC's motherboard died, I got another computer and put in my old hard drive from the broken PC. This worked fine, though eth0 then became eth1. Now that I replaced the motherboard, I put the hard drive from my replacement PC into my old desktop PC, and there eth1 now became eth2. How can I fix that? Do I need to fix this, or should I ignore it?

Thanks.

lems

kikinovak 09-13-2013 10:34 AM

Take a peek in /etc/udev/rules.d/70-persistent-net.rules. You should find a series of stanzas like this one:

Code:

# PCI device 0x10ec:/sys/devices/pci0000:00/0000:00:0a.0/0000:02:00.0 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:1f:d0:ae:ec:fe", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*",
NAME="eth0"

Edit them according to your needs, e. g. NAME="ethX".

Cheers,

Niki

vdemuth 09-13-2013 10:53 AM

I have something similar going on here with a motherboard with 2 network interfaces. But it seems they both have the same mac address, which in itself is odd.

Tried editing the 70-persistent-net-rules file but eth0 keeps getting changed to rename2. Any ideas what I can do to alter this. For instance, is there a permanent way to change the mac address of one of the i/faces?

TIA

FeyFre 09-13-2013 11:12 AM

It must be so. System remembers network interfaces it ever found in system permanently(by its MAC) and associates own eth# name for each.
However you can reset this. Just remove file /etc/udev/rules.d/70-persistent-net.rules

lems 09-13-2013 11:46 PM

Yep, editing the udev rule did the trick. Thanks a lot.


All times are GMT -5. The time now is 11:34 PM.