From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 08:50:35 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 C8DD316A4CE for ; Mon, 26 Jan 2004 08:50:35 -0800 (PST) Received: from smtp-out6.blueyonder.co.uk (smtp-out6.blueyonder.co.uk [195.188.213.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 943D643D41 for ; Mon, 26 Jan 2004 08:50:32 -0800 (PST) (envelope-from xfb52@dial.pipex.com) Received: from dial.pipex.com ([82.41.37.129]) by smtp-out6.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Mon, 26 Jan 2004 16:50:53 +0000 Message-ID: <40154557.3060906@dial.pipex.com> Date: Mon, 26 Jan 2004 16:50:31 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6b) Gecko/20040105 X-Accept-Language: en, en-us MIME-Version: 1.0 To: addymin@pacbell.net References: <401542F2.8000309@pacbell.net> In-Reply-To: <401542F2.8000309@pacbell.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Jan 2004 16:50:53.0937 (UTC) FILETIME=[8FD60E10:01C3E42C] cc: freebsd-questions Subject: Re: Configuring IP address aliasing 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: Mon, 26 Jan 2004 16:50:35 -0000 Mike wrote: > # ifconfig -a > ed0: flags=8843 mtu 1500 > inet 192.168.1.40 netmask 0xffffff00 broadcast 192.168.1.255 > # ifconfig ed0 alias 192.168.1.41 netmask 255.255.255.0 broadcast > 192.168.1.255 > ifconfig: ioctl (SIOCAIFADDR): File exists > [using same netmask as real interface] > However, THIS WORKED: > # ifconfig ed0 alias 192.168.1.41 netmask 255.255.255.255 broadcast > 192.168.1.255 > [using a netmask of 255.255.255.255] > > QUESTION: Why do I use a different netmask (255.255.255.255) for a IP > alias on FreeBSD? Why isn't 255.255.255.0 used? From the ifconfig man page on 4.9 alias Establish an additional network address for this interface. This is sometimes useful when changing network numbers, and one wishes to accept packets addressed to the old interface. If the address is on the same subnet as the first network address for this interface, a non-conflicting netmask must be given. Usually 0xffffffff is most appropriate. Since 192.168.1.41 is on the same subnet as 92.168.1.40 you must use 0xffffffff (aka 255.255.255.255) as the netmask. (I don't know *why* I'm afraid). You could always stick the alias on a different subnet at which point you can use the netmask you expect. e.g. # ifconfig ed0 alias 192.168.2.40 netmask 255.255.255.0 broadcast 192.168.2.255 --Alex