proper ip address aliasing

Rick Stevens rstevens at vitalstream.com
Wed Feb 2 17:59:12 UTC 2005


jdyke wrote:
> I need to add a group of virutal ips to a single interface on FC3. I've 
> used
> `ip addr add 192.168.2.XX dev eth0` to add the ips which worked fine, 
> but what is the best/proper way to add them at boot up.  I'd assume i 
> could add them in rc.local which should work?  but is that right?

The proper way is to create additional scripts in the
"/etc/sysconfig/network-scripts" directory.  They should be named
"ifcfg-eth0:x", with "x" being the alias number.  If you're adding 3
aliases to eth0, for example, the files would be:

	ifcfg-eth0	(primary, leave it alone)
	ifcfg-eth0:1	(first alias)
	ifcfg-eth0:2	(second alias)
	ifcfg-eth0:3	(third alias)

Inside those "ifcfg-eth0:x" scripts, you only need four lines:

	DEVICE=eth0:x		(replace "x" with the alias number)
	IPADDR=xxx.xxx.xxx.xxx
	NETMASK=xxx.xxx.xxx.xxx
	ONBOOT=yes

The first one, "ifcfg-eth0" should be left alone, as it sets up the
base device.

That's the "official" way to do it and the way "system-config-network"
or "Fedora Icon->System Settings->Network" do it, which would allow you
to manage them via the GUI system.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-          When all else fails, try reading the instructions.        -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list