From owner-freebsd-questions@FreeBSD.ORG Thu Feb 21 12:35:24 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3259C16A403 for ; Thu, 21 Feb 2008 12:35:24 +0000 (UTC) (envelope-from siraj.shaikh@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.190]) by mx1.freebsd.org (Postfix) with ESMTP id 083DB13C469 for ; Thu, 21 Feb 2008 12:35:23 +0000 (UTC) (envelope-from siraj.shaikh@gmail.com) Received: by rv-out-0910.google.com with SMTP id g13so8275rvb.43 for ; Thu, 21 Feb 2008 04:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=krsvJzBtMuuPcplL/GFqVXaZGihVqk9VRjv2wutcw5Y=; b=ScL1P0h/1PwTT2d1p58O7d1EaacIHsxNxQUuTl0a+/X1rCXjqlCyxuHRMqf8KLbfTyiaHiVlk80/yMrgnyKK685O4z6VoxbE4xiXbeSauF+WWQv4dUV1qbLvq/AxLxV00mgryRu7CofVUolgq0eNNyeRHtVbMUeZ8r1tM2HErVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jwb1l3JlouLk/R6GoX0z7YupfmO8AVfz+rOVMZBKcMQmDZPoEaqEm1GpA8rN7E1sXaxsxB6RtCracuzDHI9sFhCSra1hA2njxogJjppE6TMnufID8XYIXJZn7z6Xie/KHrH5DueogEfD1fqtdIOrVdOPDymIdHj7RVoX+VEx+ag= Received: by 10.141.169.9 with SMTP id w9mr6665996rvo.77.1203597323149; Thu, 21 Feb 2008 04:35:23 -0800 (PST) Received: by 10.140.162.17 with HTTP; Thu, 21 Feb 2008 04:35:23 -0800 (PST) Message-ID: <3b2ddd940802210435n5d460dc1l82615e927255e2a6@mail.gmail.com> Date: Thu, 21 Feb 2008 12:35:23 +0000 From: "Siraj Shaikh" To: Mel In-Reply-To: <200802211333.36144.fbsd.questions@rachie.is-a-geek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3b2ddd940801280627m6d747cd1g27682bcd9e50ceb7@mail.gmail.com> <200801290234.m0T2YtLn074403@banyan.cs.ait.ac.th> <3b2ddd940802210407j7b83059duabadeccaec53a26c@mail.gmail.com> <200802211333.36144.fbsd.questions@rachie.is-a-geek.net> Cc: freebsd-questions@freebsd.org Subject: Re: IP Aliasing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2008 12:35:24 -0000 On 21/02/2008, Mel wrote: > On Thursday 21 February 2008 13:07:08 Siraj Shaikh wrote: > > > ifconfig_ed0_alias0="inet 127.0.0.251 netmask 0xffffffff" > > ifconfig_ed0_alias1="inet 127.0.0.252 netmask 0xffffffff" > > ifconfig_ed0_alias2="inet 127.0.0.253 netmask 0xffffffff" > > > > Just want to know, as I want to configure about 253 addresses as an > > alias on a single machine (along with the primary address, this will > > be 254 address, a whole C-class subnet) - and would like these entries > > to hold when I boot. Also, is there any shortcut to adding a range of > > net/host address or would I have to add a line for each address? > > > Yes and yes. Yes it needs one line per alias and yes, there's a shortcut: > > for i in $(jot - 0 254); do > echo ifconfig_ed0_alias${i}="\"inet 127.0.0.$((i+1)) netmask 0xffffffff\"" > done >>/etc/rc.conf > > Wouldn't do this with 127.0.0 btw, but I figured you wouldn't. You'd also have > to make a provision for the main IP, but then again, it's easier to remove > the specific line by hand. > -- > > Mel > Thanks Mel - very helpful indeed Siraj