Configure Multiple IP Adresses on single interface

#cd /etc/sysconfig/network-scripts
step1 --> #cp  ifcfg-eth0   ifcfgeth0:1

#cat ifcfg-eth0

DEVICE="eth0"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
HWADDR=00:0C:29:28:FD:4C

step 2 -->
#vim ifcfg-eth0:1
DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes

To setup up a range of ip address range assigned to n.w interface
#cp  ifcfg-etho ifcfg-etho-range0

                        #vim ifcfg-eth0-range0

#DEVICE="eth0"
BOOTPROTO=none
NM_CONTROLLED=no
ONBOOT=yes
TYPE="Ethernet"
IPADDR_START=192.168.0.120
IPADDR_END=192.168.0.190
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
CLONENUM_START=22   #{if   eth0:1,eth0:2 ..eth0:21 are already occupied} it will start from eth0:22
#GATEWAY=192.168.0.1


#service network reload
  you can also give different range/n.w address ..see the example below

No comments:

Post a Comment