[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Assigning to new NICs the previous interface names.



On Thu, 29 Jul 2010 03:06:24 -0400 (EDT), Sthu Deus wrote:
> 
> Is possible to be done somehow automatically (by the tools available
> for Debian and not writing my own scripts)?

I haven't been following this thread; so I don't know what specific
problem you are trying to solve.  But for me, the most common case
is that I have one network card which I need to replace and I want
it to have the interface name eth0, just like the original one.  There
are no other network cards in the machine.

For that specific case, the easist solution is to simply erase (rm)
the /etc/udev/rules.d/70-persistent-net.rules file.  Then shutdown,
swap network cards, and boot up.  During boot, a new
/etc/udev/rules.d/70-persistent-net.rules file will be created, and
it will list the MAC address of the new card and assign it to eth0.

For machines with two network cards, it's not much more difficult.
Let's say that card1 is assigned to eth0 and card2 is assigned to
eth1.  You want to replace one of them.  Edit the file
/etc/udev/rules.d/70-persistent-net.rules and delete the line(s)
which describe the card you want to replace.  Then shutdown,
swap cards, and boot up.  During boot, a new line will be added to
/etc/udev/rules.d/70-persistent-net.rules which describes the new card,
and it will be assigned to the interface that was deleted.  Make a
backup copy of the file somewhere else before editing or deleting it,
just in case, but the procedure I described will probably work just fine.

-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-


Reply to: