From owner-freebsd-net@FreeBSD.ORG Sat Feb 18 10:39:31 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1255A106566C for ; Sat, 18 Feb 2012 10:39:31 +0000 (UTC) (envelope-from ml@my.gd) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC208FC08 for ; Sat, 18 Feb 2012 10:39:29 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so3150279wib.13 for ; Sat, 18 Feb 2012 02:39:28 -0800 (PST) Received-SPF: pass (google.com: domain of ml@my.gd designates 10.180.86.9 as permitted sender) client-ip=10.180.86.9; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ml@my.gd designates 10.180.86.9 as permitted sender) smtp.mail=ml@my.gd Received: from mr.google.com ([10.180.86.9]) by 10.180.86.9 with SMTP id l9mr2966583wiz.15.1329561568871 (num_hops = 1); Sat, 18 Feb 2012 02:39:28 -0800 (PST) Received: by 10.180.86.9 with SMTP id l9mr2518214wiz.15.1329561568817; Sat, 18 Feb 2012 02:39:28 -0800 (PST) Received: from dfleuriot.local (did75-17-88-165-130-96.fbx.proxad.net. [88.165.130.96]) by mx.google.com with ESMTPS id ft8sm2632730wib.11.2012.02.18.02.39.27 (version=SSLv3 cipher=OTHER); Sat, 18 Feb 2012 02:39:28 -0800 (PST) Message-ID: <4F3F7FDF.8060202@my.gd> Date: Sat, 18 Feb 2012 11:39:27 +0100 From: Damien Fleuriot User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 MIME-Version: 1.0 To: Andrew Boyer References: <1329376106.7683.YahooMailNeo@web162203.mail.bf1.yahoo.com> <4F3D0197.60100@my.gd> <37B92AD6-F745-4D26-A924-271476558D93@averesystems.com> In-Reply-To: <37B92AD6-F745-4D26-A924-271476558D93@averesystems.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQloAygM97+A/f1MtuzdomE7D2pZu6i5wEtHzxqiXYKMuoqoUQFH5QXiosTf+keK1/N9ZKSv Cc: freebsd-net@freebsd.org, "M. V." Subject: Re: Assigning multiple IPs in the same network to an interface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 10:39:31 -0000 On 2/16/12 3:39 PM, Andrew Boyer wrote: > > On Feb 16, 2012, at 8:16 AM, Damien Fleuriot wrote: > >> On 2/16/12 8:08 AM, M. V. wrote: >>> hi everybody, >>> >>> i have a problem with setting multiple IPs in the same network in FreeBSD: >>> >>> - suppose I assign two new IP addresses in the same network to eth0 with ifconfig: >>> #ifconfig eth0 add 192.168.10.1/24 >>> #ifconfig eth0 add 192.168.10.2/24 >>> >>> - everything works fine and the output of "netstat -r" is like what it should be: >>> #netstat -r >>> .... >>> 192.168.10.0 eth0 >>> 192.168.10.1 lo0 >>> 192.168.10.2 lo0 >>> ... >>> >>> - but now if I delete first IP address, connection to 192.168.10.0 network will be gone. and in output of "netstat -r" the route to 192.168.10.0 (via eth0) is gone: >>> #ifconfig eth0 delete 192.168.10.1 >>> >>> #netstat -r >>> .... >>> >>> 192.168.10.2 lo0 >>> ..... >>> >>> - am i missing something here? shouldn't the route to the network remain in routing table (because we still have 192.168.10.2 assigned to interface)? >>> >>> Thanks. >>> >> >> You shouldn't assign your secondary IP with a /24 mask, use /32. >> >> You'll run into problems otherwise. >> >> As a rule of thumb, your aliases = /32 >> > > M.V. - > What you are doing should work fine. There were a handful of routing table bugs fixed in the last few months that corrected this behavior. The last two were just merged to stable/8 yesterday. What release are you running? > > -Andrew > This is of interest to me. Do these fixes allow one to use say /24 aliases instead of /32 without running into problems ?