how to disable a NIC in centos

Solution 1:

One liner? How about this as root?

echo "DEVICE=eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0 && service network restart

It will remove the configuration for eth0 and replace it with something that is unconfigured.

Solution 2:

In /etc/sysconfig/network-scripts/ifcfg-eth0 you need to have

ONBOOT=no

like MDMarra said but you also need to have

NM_CONTROLLED=no

or else the NetworkManager will boot the interface as it ignores the ONBOOT setting. Unless you don't use NetworkManager but I think it is common.