Multiple IP addresses without aliasing?
Mike Wright
mike.wright at mailinator.com
Fri Aug 28 21:59:35 UTC 2009
Ryan Lynch wrote:
> On Fri, Aug 28, 2009 at 17:36, Sam Varshavchik<mrsam at courier-mta.com> wrote:
>> Ryan Lynch writes:
>>
>>> Do the Fedora network init scripts support additional secondary IP
>>> addresses without the use of alias labels? Does an option for IPv4
>>> addresses exist that works like IPV6ADDR_SECONDARIES?
>>>
>>> I just skimmed /usr/share/doc/initscripts-*/sysconfig.txt, but I
>>> didn't see anything to that effect, so I'm guessing the answer is no,
>>> and I have to use aliases and 'ifcfg-eth?:0' files.
>> Yes, at least for IPv4. There is absolutely no support from the GUI, but you
>> can manually install /etc/sysconfig/network-scripts/ifcfg-ethX:Y. For
>> example, I have an ifcfg-eth1 and an ifcfg-eth1:1, with a second IP address.
>> Just copy ifcfg-ethX to ifcfg-ethX:1, and stick in an additional IP address.
>
> That's exactly what I'm trying to avoid--I don't want Fedora to add
> the 'eth0:0', 'eth0:1', etc. labels. I'm wondering if the init
> scripts support multiple addresses WITHOUT aliases.
>
I've never been able to find a solution to that that didn't require
running another script. /etc/rc.local is a kind of "catch all". There
are also /etc/sysconfig/network-scripts/ifup-post and ifdown-post.
Using iproute2 certainly gives good control.
ip address add 10.20.30.40/8 dev eth0
ip address add 10.20.30.41/16 dev eth0
ip address add 10.20.30.42/24 dev eth0
ip address add 10.20.30.43/32 dev eth0
ip address add 192.168.1.1/24 dev eth0
is an example of how to add addresses to an interface.
You may also use the same command to setup routes for your new found
diversity of addresses :)
More information about the users
mailing list