# [solved] weird numbering of network devices after cloning..

## oliwel

Hi Folks,

I have a very weird error here - I have two boxes which are nearly equal regarding hardware, I setup the first box which works fine, I copied over the whole filesystem to the second box and have now troubles with the NICs.

On Box A (the original setup) I have two NICs which are correctly numbered as eth0 and eth1.

On Box B (the cloned one) I have two NICs which are numbered as eth2 and eth3, no eth0/1 shows up on this box, there is no other hardware that I can image to take this numbers.

Does udev daemon use cashed data from the old node? If so were can I find it and reset it to have eth0/eth1 back again.

OliverLast edited by oliwel on Tue May 15, 2007 7:45 am; edited 1 time in total

----------

## mudrii

what is output from ifconfig -a ?

what script is in /etc/init.d/net.ethX ?

----------

## oliwel

ifconfig -a shows only eth2 and eth3 

I had eth0 and eth1 scripts in init.d what failed - now I have eth2 and eth3 in there and it works.

Oliver

----------

## JeliJami

remove the udev network rules file:

```
# rm /etc/udev/rules.d/70-persistent-net.rules
```

and reboot

or edit that file so that the mac addresses match

----------

## pharoh

Hi all,

   we recently have started to have a problem on new loads of Gentoo where the network adapters eth0 and eth1 show up as eth2 and 3 but in dmesg we can see they are detected as 0 and 1 then renamed.  any ideas?  the systems are all using gentoo-sources 2.6.18/19/20 and the e1000 driver.

----------

## PaulBredbury

Look for renaming:

```
grep eth /etc/modprobe.conf

grep eth /etc/udev/rules.d/*
```

----------

## jschweg

This happened when I upgraded udev.

I just renamed the interface back to eth0 in /etc/udev/rules.d/*-persistent-net.rules

----------

## pharoh

yes it is looking at the original machine and not the imaged machine so it adds 2 new nics.  nice feature but wish it was in the notes during an emerge  :Sad: 

THANK YOU!

----------

## nixnut

merged above four posts here.

----------

## anjgentoo

[quote="davjel"]remove the udev network rules file:

```
# rm /etc/udev/rules.d/70-persistent-net.rules
```

and reboot

I have had this problem after changing my failed main board to a new model. Solved by removing the udev file above, thanks.

----------

## hidrogen

I have some gentoo virtual machines on a computer with windows xp.

After a reboot i lost my network connections. The network interfaces used to be eth0 and eth1 but after doing cat /proc/net/dev instead of having eth0 and eth1 i had eth3 and eth4.

The module pcnet32 is loaded when i boot the virtual machines. How can i rename my interfaces back to the eth0 and eth1? Anyone knows why this happened?

Thanks in advance

----------

## Dagger

check/post

```

/etc/udev/rules.d/70-persistent-net.rules

```

----------

## hidrogen

It seems i don't have that file. What should i do now?

 *Dagger wrote:*   

> check/post
> 
> ```
> 
> /etc/udev/rules.d/70-persistent-net.rules
> ...

 

----------

## nixnut

merged above three posts here.

----------

## hidrogen

 *Dagger wrote:*   

> check/post
> 
> ```
> 
> /etc/udev/rules.d/70-persistent-net.rules
> ...

 

I removed the file and rebooted my gentoo. It worked. But is there any way to do that without rebooting?

----------

## jniklast

running udevstart should do the trick

----------

## peaceful

I have two identical x86 servers.  I just installed Gentoo on one of them, and then cloned the disk (used a disk duplication thing to copy the whole disk block-by-block) and put it in the second one.

Everything works EXCEPT the network ports on the second one show up as eth2 and eth3 instead of eth0 and eth1!!!!

How can I get those switched back to eth0 and eth1?  I have some scripts that deal with network interfaces that I want to work on both machines, and I really don't want to deal with the network ports being named differently on each machine.  (the whole point of the machines is for them to be identical)

Any suggestions would be welcome.

~ Peaceful

----------

## Wormo

udev is reserving eth0 and eth1 for ethernets that have MAC addresses from your original box.

On the second box, edit /etc/udev/rules.d/70-persistent-net.rules and update the MAC addresses for eth0 and eth1 to match the HW address of the cards in that box.

----------

## peaceful

 *Wormo wrote:*   

> udev is reserving eth0 and eth1 for ethernets that have MAC addresses from your original box.
> 
> On the second box, edit /etc/udev/rules.d/70-persistent-net.rules and update the MAC addresses for eth0 and eth1 to match the HW address of the cards in that box.

 

I figured it would be something like that.  Thanks for the quick response!  I'll go try that right now.

----------

## nixnut

merged above three posts here.

----------

