how to add a few hundred ip on one interface?

patrick gibblertron at gmail.com
Thu Feb 10 23:52:36 UTC 2011


The standard way is to configure this in your /etc/rc.conf[.local]:

ifconfig_re0="inet xxx.xxx.yyy.134 netmask 0xffffffnn"
ifconfig_re0_alias0="inet xxx.xxx.yyy.135 netmask 0xffffffff"
ifconfig_re0_alias1="inet xxx.xxx.yyy.136 netmask 0xffffffff"
... etc.

You could make a script to generate the correct configuration lines,
and then include it in your rc.conf:

/etc/rc.conf:

. /path/to/ifconfig_entries.sh

/path/to/ifconfig_entries.sh:
ifconfig_re0="inet xxx.xxx.yyy.134 netmask 0xffffffnn"
ifconfig_re0_alias0="inet xxx.xxx.yyy.135 netmask 0xffffffff"
ifconfig_re0_alias1="inet xxx.xxx.yyy.136 netmask 0xffffffff"

See http://www.freebsd.org/doc/en/books/faq/networking.html#ETHERNET-ALIASES
for more info. Note that aliases should have a netmask of 0xffffffff
(255.255.255.255).

Patrick


On Thu, Feb 10, 2011 at 3:36 PM, Vladislav V. Prodan <universite at ukr.net> wrote:
> only a shell script at startup? or there are other standard tools?
> Is there a limit on the number of IP on one interface?
>
> ## make aliases IP
> for i in 134 135 136 137 138 139 140 141 142 143 144 145 146 147
> do
> ifconfig re0 xxx.xxx.yyy.$i/23 alias
> done
>
> for j in 134 135 136 137 138 139 140 141 142 143 144 145 146 147
> do
> ifconfig re0 xxx.xxx.xxx.$i/23 alias
> done
>
>
>
> --
> Vladislav V. Prodan
> VVP24-UANIC
> +38[067]4584408
> +38[099]4060508
> vlad11 at jabber.ru
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>


More information about the freebsd-questions mailing list