Centos – How to add interface alias on RHEL6 or CentOS6 with NetworkManager

centoscentos6networkmanagerredhatrhel6

How to add a network interface alias (for example eth0:0) on CentOS6 or RHEL6 in the "correct" way that is through NetworkManager without NM_CONTROLLED=no. And this has to be done without GUI.

Thank you,
a

Best Answer

run following commands as root:-

  1. cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
  2. vi /etc/sysconfig/network-scripts/ifcfg-eth0:0

Find entry that read as follows:

DEVICE=eth0

Replace with:

DEVICE=eth0:0

Find entry that read as follows:

IPADDR=

Replace it with additional IP address you want to give the machine:

IPADDR=172.134.54.1

4.run:-

ifup eth0:0

or service network restart

similarly you can add additional ip addresses.

for more details refer to :- http://www.cyberciti.biz/faq/linux-creating-or-adding-new-network-alias-to-a-network-card-nic/