I did setup a virtual network interface in Centos 6 copying the ifcfg-eth0 to ifcfg-eth0:1 and changing the appropriate variables. But the connection was unstable. Although one of the pre-existent variables was PREFIX=24
I had to add NETMASK=255.255.255.0
to the virtual interface script to make the connection stable. Shoudn't these variables have the same effect?
EDIT:
This is ifcfg-eth0:1 unstable:
DEVICE="eth0:1"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=00:26:18:24:4D:xx
TYPE=Ethernet
BOOTPROTO=none
IPADDR=69.64.93.x
PREFIX=24
GATEWAY=64.150.183.1
DNS1=69.64.66.11
DNS2=69.64.66.10
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0:1"
In the stable one I just added this line:
NETMASK=255.255.255.0
ifconfig
output with unstable first and stable after:
eth0:1 Link encap:Ethernet HWaddr 00:26:18:24:4D:xx
inet addr:69.64.93.x Bcast:69.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:28 Base address:0x6000
eth0:1 Link encap:Ethernet HWaddr 00:26:18:24:4D:xx
inet addr:69.64.93.x Bcast:69.64.93.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:28 Base address:0x6000