How to install network adapter in Linux (CentOS 5)

33,071

The easiest way is to have the new card assume the same device name (eth0). Do this by:

  • Delete the /etc/udev/rules.d/70-persistent-net.rules file. This is the file that ties hardware devices to ethX interfaces, causing your replacement card to become eth1 or eth2. Hopefully we can prevent that.
  • Shutdown the server ( shutdown -h now from a commandline should do the trick ).
  • Disable the onboard NIC in the BIOS, or remove the defective card.
  • Start the system up again. If the replacement card has assumed the same ethX device, it should start up with the same networking configuration. Check with ip addr or ifconfig -a.

These steps assume you have a fairly simple server which had one ethernet card, and needs to have it replaced with another single ethernet card.

Share:
33,071
Jess Riedel
Author by

Jess Riedel

Updated on September 18, 2022

Comments

  • Jess Riedel
    Jess Riedel over 1 year

    My company has a CentOS 5 Linux server. The network card died today and we replaced it with an Intel Pro 1000 GT network adapter.

    I'm not great with Linux. How can I get this new NIC working?

    Thanks

    • Ignacio Vazquez-Abrams
      Ignacio Vazquez-Abrams about 13 years
      What are the PCI IDs of the card?
    • Jess Riedel
      Jess Riedel about 13 years
      @Ignacio - I don't know what that means. How do I find that?
    • Ignacio Vazquez-Abrams
      Ignacio Vazquez-Abrams about 13 years
      Run lspci -nn.
  • Jess Riedel
    Jess Riedel about 13 years
    The nics listed by ifconfig -a are eth1 and eth2. I'm pretty sure that eth2 is the new adapter. In /etc/sysconfig/network-scripts, I don't see ifcfg-eth0, but I do see ifcfg-eth0.bak. Should I use that for the config?
  • Eduardo Ivanec
    Eduardo Ivanec about 13 years
    It depends on whether the old adapter was eth0 or eth1. If it was eth0 go with ifcfg-eth0.bak, otherwise use ifcfg-eth1 if available. A "simple" if somewhat convoluted way to find out which NIC is which eth* is to take the MAC address listed by ifconfig and run it through a site like this. This only works if each NIC comes from a different vendor, though!
  • Soviero
    Soviero over 12 years
    You could also open the "70-persistent-net.rules" in a text editor, and simply remove the line that corresponds to the old/dead NIC. Thus making it so that only the new card will get the old one's ID.