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

Re: nic issue on Debian Lenny



On Thu, 25 Mar 2010 23:16:59 -0400 (EDT), Roman Gelfand wrote:
> 
> My server has two onboard nics.  I am using etho.  For the longest
> time it was working no problem.  Then it just lost network
> connectivity.    When running ifconfig I get RX packets:0.
> 
> Would any one know a way to fix it?  I had similar problem with
> centos.  The solution there was to assign eth1 device to alias eth0.
> 
> Any help is appreciated.

Roman,

First of all, when you say that you have "two onboard nics", I
interpret that to mean that there are two network adapters built-in
to the motherboard, as opposed to separate network adapters installed
in a bus-slot.  Is that what you mean?  That would be unusual.
It's quite common to see a motherboard with a built-in ethernet
adapter, but I haven't seen any motherboards with *two* built-in
ethernet adapters.  Usually, if a machine has two ethernet adapters,
it either has two stand-alone NICs or else it has one NIC built-in
to the motherboard and one stand-alone NIC.  But anyway ...

Each network adapter (I assume they are both ethernet) has a
MAC (Media Access Control) address built-in to it.  This MAC
address is assigned by the manufacturer when the board is made, and
is unique to that physical board.  Another board of that same identical
make and model will have a different MAC address.  Linux uses this MAC
address to uniquely identify Ethernet adapters.  udev creates rules to
determine which MAC address to assign to eth0, which MAC address to assign
to eth1, etc.  These rules are stored in directory /etc/udev/rules.d.
The exact name of the file to look at is dependent on the machine
architecture and which release of udev you have, but
"persistent-net" is the key phrase to look for.  On my Debian Lenny
machine for the i386 architecture, the file is called
70-persistent-net.rules.

Typically, this type of problem happens
when one of the ethernet adapters is replaced.  In the case of an
ethernet adapter built-in to the motherboard, that would mean
that the motherboard gets replaced.  Or sometimes it happens
as the result of moving a hard drive from one computer to another,
which, as viewed by the operating system stored on that hard drive,
means that the NICs changed.  In the case of a stand-alone NIC
you can move the old NIC to the new machine, but in the case of
a NIC built-in to the motherboard, you would need to swap motherboards
to keep the MAC address the same, and most people don't do that.

In any event, the solution is to edit that file
(/etc/udev/rules.d/70-persistent-net.rules) and change the MAC
addresses in that file according to which one you want to be eth0
and which one you want to be eth1.  In the case of a computer
with only one network connection, I usually advise people to erase
that file, it which case it will be regenerated at the next boot
with eth0 assigned to the one and only MAC address.  But in the
case of multiple adapters, I advise people to edit the file.

   ifconfig -a

will show you the MAC addresses of the cards currently present
in the machine (look for "HWaddr").  Compare that to the MAC
addresses in /etc/udev/rules.d/70-persistent-net.rules.  From
that you should be able to figure out which MAC address belongs
to the old card that is no longer installed and which "device"
it used to be.  Change the entry for the new card to match that
device name and delete the entry for the old MAC address.  Then,
shutdown and reboot.

-- 
  .''`.     Stephen Powell    <zlinuxman@wowway.com>
 : :'  :
 `. `'`
   `-


Reply to: