how to attach class C net to an interface?
Artem Koutchine
matrix at itlegion.ru
Fri Jun 4 00:38:12 PDT 2004
> > I have a server with one interface and many virtual web hosts.
> > I have been given class C network to use for the virtual
> > web hosts and jails on the server. How to i tell the interface
> > that all addresses of some A1.A2.A3.A4 0xFFFFFF00
> > network belong to the interface. Do i specify 250-some aliases?
> > Or there is a better way?
> >
>
> Unfortunately, there is no built-in solution I know of to add aliases in
> bulk - you need to issue individual ifconfig commands. As such, you can
> do it on the command-line using a loop such as this:
>
> for (( foo = 1; foo < 255; foo++ )); \
> do ifconfig fxp1 alias 172.16.100.$foo netmask 0xffffffff; \
> done
>
> This will add the aliases 172.16.100.1 through 172.16.100.254 to the
> fxp1 interface. All you need to do is change the command to reflect
> your requirements for the network number and interface name, and you
> should be good to go. You can add this command into /etc/rc.local to
> have it run at startup.
>
Thank you for the scrip. I will then asign a single main ip to the interface
in rc.conf and then run this script from /usr/local/etc/rc.d because i think
rc.local is merged after each cvp/buildworld/installworld/mergmaster,
so /usr/local/etc/rc.d is a safer place to to keep it. Right or not?
The other question, will assigning 200+ ip addresses degrade tcp/ip
perfomance noticeably?
How to i spell noticably or noticaebly? :)
Regards,
Artem
More information about the freebsd-questions
mailing list