Nocser Technology | Main Page
Please Login or Register

Knowledgebase

Add a Virtual NIC or Network Card

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?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution

Language:

Quick Navigation

Client Login

Email

Password

Remember Me

Search



Follow Us on Twitter