0

Adding a Network Card to CentOS Linux

image_pdfimage_print

Detect & Configure The New Network Adapter

1. Determine existing network interfaces

ifconfig -a
2. Change directory to the network scripts folder
cd /etc/sysconfig/network-scripts
3. Clone the existing eth0 device network script
cp ifcfg-eth0 ifcfg-eth1 # this assumes the old card was eth0 and the new one is eth1
4. Get the Hardware Address for the eth1 network card, again this assumes the new card is eth1
grep eth1 /etc/udev/rules.d/70-persistent-net.rules
#you can get fancy and use awk and cut to isolate the string containing the Hardware Address
grep eth1 /etc/udev/rules.d/70-persistent-net.rules | awk -F"," '{print $4}' | cut -d= -f3
5. Replace all occurences of eth0 with eth1 in the new network configuration script
sed -i 's/eth0/eth1/g' ifcfg-eth1 # or edit it by hand and change eth0 to eth1 where it appears
6. Edit the eth1 network configuration script and replace the Hardware Address with the one in the 70-persistent-net-rules file
vi ifcfg-eth1
7. Bring the eth1 interface up
ifup eth1

Bert Tejeda

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected with IP Blacklist CloudIP Blacklist Cloud