1

I have a 12 IPv4 addresses that I need to add to a CentOS 6.3 machine however those 12 IPs are spread out among 3 different subnets. I know how to add additional IPs when they are on the same subnet, but how can I do it with different subnets?

Is there a certain value to put in the ifcfg-eth0-range1 file such as GATEWAY=X.X.X.X?

Thanks

user1710563
  • 141
  • 5

1 Answers1

0

Create subinterfaces:

/etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.0.1
NETMASK=255.255.255.0
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth0:1
IPADDR=172.16.0.1
NETMASK=255.255.255.0
ONPARENT=yes

/etc/sysconfig/network-scripts/ifcfg-eth0:2
IPADDR=10.0.0.1
NETMASK=255.255.255.0
ONPARENT=yes

You could combine this with range files if you wish, and if your IPs are all consecutive.

suprjami
  • 3,476
  • 20
  • 29