range of IPs in rc.conf

2009-04-05 Thread luc...@lastdot.org

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

Anything similar available for FreeBSD?

Thanks
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: range of IPs in rc.conf

2009-04-05 Thread Glen Barber
On Sun, Apr 5, 2009 at 7:46 AM, luc...@lastdot.org luc...@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.

-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: range of IPs in rc.conf

2009-04-05 Thread Matthew Seaman

Glen Barber wrote:

On Sun, Apr 5, 2009 at 7:46 AM, luc...@lastdot.org luc...@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

--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: range of IPs in rc.conf

2009-04-05 Thread luc...@lastdot.org

Matthew Seaman wrote:

Glen Barber wrote:
On Sun, Apr 5, 2009 at 7:46 AM, luc...@lastdot.org 
luc...@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!

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org