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.
You should first check you see it listed with this command:
ifconfig -a
Each entry beginning with 'eth' stands for a detected network card. If you see none, you will have to troubleshoot as it's likely unsupported.
If you do see it listed, remember its name (for example: eth1) and do this:
cd /etc/sysconfig/network-scripts
cp ifcfg-eth0 ifcfg-eth1 # this assumes the old card was eth0 and the new one is eth1
sed -i 's/eth0/eth1/g' ifcfg-eth1 # or edit it by hand and change eth0 to eth1 where it appears
Then reboot.
I hope it's clear and it works. You can do it other ways, but this is quick and I think has the advantage of using the old config so you get to keep IP, netmask and other configs by default.
Each nic will get a new ethN interface number. From what you've said, it sounds like eth0 is the interface that died and eth2 is the new NIC you'd like to use.
First, look at the config file for eth0.bak. That should give you some clues as to how the interface was previously setup. Note the IP address, netmask, and default route. Double check these in your DNS and network configuration.
Next, see if you have the following utility installed: system-config-network. I like the command line version but there is a GUI version as well. For details see here:
Do ifconfig -a too see which network adaptors are conencted to the box, then assign an IP to it by doing ifconfig eth# 192.168.0.2 netmask 255.255.255.0 or whatever your IP is.
The easiest way is to have the new card assume the same device name (eth0). Do this by:
shutdown -h now
from a commandline should do the trick ).ip addr
orifconfig -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.
You should first check you see it listed with this command:
Each entry beginning with 'eth' stands for a detected network card. If you see none, you will have to troubleshoot as it's likely unsupported.
If you do see it listed, remember its name (for example: eth1) and do this:
Then reboot.
I hope it's clear and it works. You can do it other ways, but this is quick and I think has the advantage of using the old config so you get to keep IP, netmask and other configs by default.
Each nic will get a new ethN interface number. From what you've said, it sounds like eth0 is the interface that died and eth2 is the new NIC you'd like to use.
First, look at the config file for eth0.bak. That should give you some clues as to how the interface was previously setup. Note the IP address, netmask, and default route. Double check these in your DNS and network configuration.
Next, see if you have the following utility installed: system-config-network. I like the command line version but there is a GUI version as well. For details see here:
http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/
If it's not installed, run "yum -y install system-config-network"
Next, run system-config-network in either text or GUI mode and move the configuration that was previously on eth0 over to your new eth2.
Next, run "service network restart"
Finally, run "ifconfig" and look at your running configuration. Try pinging a few hosts to make sure you are all setup.
Do
ifconfig -a
too see which network adaptors are conencted to the box, then assign an IP to it by doingifconfig eth# 192.168.0.2 netmask 255.255.255.0
or whatever your IP is.