Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jun 2004 11:36:10 +0400
From:      "Artem Koutchine" <matrix@itlegion.ru>
To:        "David Fuchs" <david@davidfuchs.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to attach class C net to an interface?
Message-ID:  <009501c44a06$9d58acb0$0c00a8c0@artem>
References:  <004401c4496f$08f83be0$7a01a8c0@nobodyfuckhead> <01fa01c44973$efe697f0$0c00a8c0@artem> <40BF6596.8090705@davidfuchs.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?009501c44a06$9d58acb0$0c00a8c0>