From owner-freebsd-questions@FreeBSD.ORG Thu Jun 3 10:50:33 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B69AE16A4CE for ; Thu, 3 Jun 2004 10:50:33 -0700 (PDT) Received: from davidfuchs.ca (domains1.davidfuchs.ca [216.113.197.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BE4643D2D for ; Thu, 3 Jun 2004 10:50:33 -0700 (PDT) (envelope-from david@davidfuchs.ca) Received: from d207-6-115-26.bchsia.telus.net ([207.6.115.26] helo=[190.190.104.2]) by davidfuchs.ca with asmtp (TLSv1:AES256-SHA:256) (Exim 4.30) id 1BVwMA-0001ST-Cf; Thu, 03 Jun 2004 10:50:22 -0700 Message-ID: <40BF6596.8090705@davidfuchs.ca> Date: Thu, 03 Jun 2004 10:53:26 -0700 From: David Fuchs User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040514 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Artem Koutchine References: <004401c4496f$08f83be0$7a01a8c0@nobodyfuckhead> <01fa01c44973$efe697f0$0c00a8c0@artem> In-Reply-To: <01fa01c44973$efe697f0$0c00a8c0@artem> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: how to attach class C net to an interface? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2004 17:50:33 -0000 Artem Koutchine wrote: > Hi! > > 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? > Hi Artem! 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. -- Thanks, -David Fuchs BCIS (david@davidfuchs.ca) WWW: http://www.davidfuchs.ca/ MSN: david@davidfuchs.ca PGP: http://www.davidfuchs.ca/aboutme/433EEC91.pgp