Add a Virtual NIC or Network Card Print

  • 0

To add a virtual nic:

ifconfig eth0:1 192.168.0.90 netmask 255.255.255.0

To confirm it is working:

ifconfig -a

You can (and should!) also give this new address its own name in the /etc/hosts file:

nano /etc/hosts

172.16.0.6 howie
192.168.30.128 howitzer

To make this permanent in RedHat / Centos. Copy eth0 to eth0:1 as virtual nic and update content as below

cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth0:1
nano ifcfg-eth0:1


DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.90
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes

Now your eth0:1 interface will start automatically at reboot, just like eth0 itself.


Was this answer helpful?

« Back