To add a virtual interface in Linux, Type the following command in your Linux Terminal
Command:
ifconfig <VIRTUAL_INTERFACE_DEVICE> <IP_ADDRESS>
For example,
ifconfig eth0:1 192.168.1.6 netmask 255.255.255.0 up This will create a new
virtual interface named eth0:1 and assigns the IP Address 192.168.1.6 to that
To Make this Virtual Interface Permenant
Create a new file /etc/sysconfig/network-scripts/ifcfg-eth0:1 with the following contents DEVICE=eth0:1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.99
NETMASK=255.255.255.0
In this way you can assign mutiple IP Address to a Single Network Card (NIC) You can create multiple Virtual Network Interfaces
To Up and Down the Virtual Interface, use the following commands
ifup eth0:1 - To Make Up
ifdown eth0:1 - To make down
What do you think about this Article? Add your Opinion..! EmoticonEmoticon