Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
3  
The same way. Whether they're on the same or different subnets makes no difference. –  David Schwartz Dec 2 '12 at 6:19

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.