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
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
run following commands as root:-
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
Find entry that read as follows:
Replace with:
Find entry that read as follows:
Replace it with additional IP address you want to give the machine:
4.run:-
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/
NetworkManager has only a very basic CLI
nmcli
which, unfortunately, is not capable of creating connections at this time (but can bring them up and down).If you need to configure a machine without a GUI it's strongly recommended you use the normal (non-NM) method as described in the documentation and do not use NetworkManager at all. I will note that you haven't actually given a reason to use NetworkManager on this system, so I have to recommend against it.
If you really have to do this, the NetworkManager way on Red Hat-derived systems is to add all of the IP addresses to the same
/etc/sysconfig/network-scripts/ifcfg-eth0
file. This was described in the NetworkManager documentation under Device Aliases.Example: