Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Apr 2009 13:41:03 +0100
From:      "lucian@lastdot.org" <lucian@lastdot.org>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>,  freebsd-questions@freebsd.org
Subject:   Re: range of IPs in rc.conf
Message-ID:  <49D8A6DF.1060805@lastdot.org>
In-Reply-To: <49D8A3D9.30000@infracaninophile.co.uk>
References:  <49D89A2B.30906@lastdot.org> <4ad871310904050522h1483d1f7lbddd504fb9f5f9e4@mail.gmail.com> <49D8A3D9.30000@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Seaman wrote:
> Glen Barber wrote:
>> On Sun, Apr 5, 2009 at 7:46 AM, lucian@lastdot.org 
>> <lucian@lastdot.org> wrote:
>>> Hi,
>>>
>>> I need to use around 30 IPs on a freebsd 7 machine. Is there a way to 
>>> avoid
>>> adding 30 lines of aliases in rc.conf? On RedHat/Centos I use this 
>>> trick:
>>> http://wiki.centos.org/TipsAndTricks/RangeOfIpsOnEthx
>>>
>>
>> You could create a customized rc file (I personally use rc.local)
>> which will be run at boot.  You could then use #!/bin/sh and a 'for'
>> loop to create the devices.
>>
>> IMHO, this solution is a lot uglier than 30 extra lines in rc.conf.
>>
> 
> If this is a contiguous range of IPs, then use the ipv4_addrs_ifN 
> construct, which you can read all about in rc.conf(5).  Eg:
> 
> ipv4_addrs_em0="192.168.64.33-63/24"
> 
>     Cheers,
> 
>     Matthew
> 

Wow, great, that's what I was looking for!

Thanks much, guys!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49D8A6DF.1060805>