Troubleshooting Ethernet NIC Configuration

Document ID : KB000047948
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

The MTP appliance should have a standard NIC configuration of eth0 and eth1. By default, eth1 may not be enabled.

Solution:

You can see the NIC configuration of enabled interfaces using the following command:

sudo /sbin/ifconfig

You can see all interfaces by adding the -a option:

sudo /sbin/ifconfig -a

The configuration itself is controlled by files found in /etc/sysconfig/network-scripts. Normally, you should see an ifcfg-eth0 and an ifcfg-eth1 file. If you see additional ifcfg-ethN files, then something may be amiss. We have seen this, for example, when System drives installed on machine A are used in machine B; the MAC addresses of the internal NICs are different which leads to the system creating additional ifcfg-ethN files.

An easy way to see the contents of the ifcfg-ethN file is to use the cat command:

cat /etc/sysconfig/network-scripts/ifcfg-eth0

The following is an example of the contents of ifcfg-eth0 for a statically configured IP address:

DEVICE=eth0
HWADDR=00:30:48:D2:CE:5C
BOOTPROTO=static
IPADDR=10.10.21.11
ONBOOT=yes
NETMASK=255.255.0.0
GATEWAY=10.10.21.1
TYPE=Ethernet

The ifcfg-ethN files can be manually edited to force the system to associate a particular device (e.g. eth0) with a particular MAC address to restore the configuration to the "standard". The ifcfg-ethN files are only writable by root, so to edit them, you will need to prefix the edit command with sudo. For example,

sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

Note: You should make sure that there is only one ifcfg file for any given HWADDR (i.e. MAC address) in this folder. If you want to make backup copies of files, make sure you put them in a different folder.

After modifying any ifcfg-ethN file, you will always need to restart the network service to have it take affect:

sudo /sbin/service network restart

Important : Troubleshooting the NIC configuration and especially modifying the ifcfg files is best done on the local console. Making a mistake when modifying these files can cause you to lose connectivity to the machine.