[CentOS] multiple external addresses on one interface

Wed Apr 13 21:51:24 UTC 2005
Johnn Tan <waterbuffalo at fastmail.fm>

ryanag at zoominternet.net wrote:
> I want to add two IP ranges on one NIC card (eth0 and eth0:1). Has
> anyone done this before? 
> 
> The CentOS 4 gui keeps locking up when I try it there and the command
> line ifconfig seems to work, but ifup always returns the error that is
> never heard (no such device) of eth0:1

If you do ifconfig, then you don't need to do ifup afterwards. It comes 
up as part of the command. ifup is if you have the device or alias 
defined and it's not up and running. For CentOS/RHEL, you define the IP 
aliases in:
/etc/sysconfig/network-scripts

In fact, assuming you want the ranges to come up after reboot, it's best 
to put them there. Note that Linux (as opposed to Solaris, I think?) 
uses eth0:0 as the first IP alias of eth0 (eth0 itself being the 
primary/non-alias IP address), not eth0:1. eth0:1 would be for the 2nd 
IP alias of eth0.

But if you're doing a range, then instead of 
/etc/sysconfig/network-scripts/ifcfg-eth0:0, you'd want
/etc/sysconfig/network-scripts/ifcfg-eth0-range0
and then instead of IPADDR=, use IPADDR_START=starting.ip.address.here 
and IPADDR_END=ending.ip.address.here

johnn