From owner-freebsd-net@FreeBSD.ORG Sat Feb 18 05:06:28 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 B2685106566C for ; Sat, 18 Feb 2012 05:06:28 +0000 (UTC) (envelope-from bored_to_death85@yahoo.com) Received: from nm4.bullet.mail.bf1.yahoo.com (nm4.bullet.mail.bf1.yahoo.com [98.139.212.163]) by mx1.freebsd.org (Postfix) with SMTP id 1A6998FC0C for ; Sat, 18 Feb 2012 05:06:27 +0000 (UTC) Received: from [98.139.212.150] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 18 Feb 2012 05:06:27 -0000 Received: from [98.139.212.251] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 18 Feb 2012 05:06:27 -0000 Received: from [127.0.0.1] by omp1060.mail.bf1.yahoo.com with NNFMP; 18 Feb 2012 05:06:27 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 515781.40482.bm@omp1060.mail.bf1.yahoo.com Received: (qmail 68297 invoked by uid 60001); 18 Feb 2012 05:06:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1329541587; bh=9nZlRXDuhUWs+DNVvil5W3dsLCUBjKDuZE0GtGJjFR4=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=kzzORbx3ZR/ayrgSyGZ62GTLWdoD5cU4SmUxFF1Vx1XM1dH9yLUimib8PoxRXXGim4sh0IYjH8Yo0alBX8E32Wa0+kY/FcPKnJNxHJc9dxZwaIoDvUYOnwk9eMRjAT6Ul9YZ0iPdyXXFUdA/E02H4Kvw/ijkhuZXM0dEHuzaB5M= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=GM2sXcrjWdQf2DjRTnn6Q01oCIhOMspyba54PfiXer6vHLTAI5Ls/JEZhwktf4W80rjkbnnhbmVdSgjG3k3AdMsDk3qUmYmSuDv3gewPt0QTNzukggGkk26ZBvHpFThwQdb/EcjV2fmBDkpXk8hIBqg5hKU5IVUbHvD488+mfh4=; X-YMail-OSG: Xw9RDmgVM1mAWQhllNhnx7NiquzbKm7Ud51coq6cuLYvytl AGCV06qnCtBM6VhnBhi9UJ5sB8HXjLyEUzFr5kg_Kt_HG88HZw4UpnA5ofhZ 7RYyk4qJWCED4TFA1932vVEzpBp3I5x8Zkv0lTT99SNKboY4PQLMu2BCou8r nKXMmTVsq8HLnABH7N6DhJp9qMmm8Kuolpmd5gDUtfKggaA1S7dsVJ03BmUa zCssC.4QqS9PABznrbqkCPdprAa9loG7egPbdJtKVc2sXk7RszwEarX1bNAN .Sog0RLpMXS__mrdVVkYg8eVUTaV6hmRbgS3eNtk9jvlZMb0L61hXkCA.OZ5 P94tGtKndReG58N.ox6QRHXdamDbhg_T7hAYUk_S3_xbfIw0fXFxcM5kewAi 8n8CAN8.jJNVZ4S.LjZqHYW1.z_kd5_bG9zWWDnrujuTx8Yti9rtmzqa2ktN aoWevbAvmBFcMMf04F.BAOefFq_dSS9M4sEZaYkxINFNb3.NgALhIKVxGYes uJJGxsAsb8cA61FVyHajeynKsjsRH2BFM3B7RL4Ta8dsIB5hTYniKtmy90lY eYPtVFWpQBve2uaRaIy.vGTXq7R7fljf8RWb.0c47OGmmeqFT.g6CZEVarw- - Received: from [89.165.120.140] by web162203.mail.bf1.yahoo.com via HTTP; Fri, 17 Feb 2012 21:06:26 PST X-Mailer: YahooMailWebService/0.8.116.338427 References: <1329376106.7683.YahooMailNeo@web162203.mail.bf1.yahoo.com> <4F3D0197.60100@my.gd> <37B92AD6-F745-4D26-A924-271476558D93@averesystems.com> Message-ID: <1329541586.68159.YahooMailNeo@web162203.mail.bf1.yahoo.com> Date: Fri, 17 Feb 2012 21:06:26 -0800 (PST) From: "M. V." To: "freebsd-net@freebsd.org" In-Reply-To: <37B92AD6-F745-4D26-A924-271476558D93@averesystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 Reply-To: "M. V." 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 05:06:28 -0000 =0A>> On 2/16/12 8:08 AM, M. V. wrote:=0A>>> hi everybody,=0A>>> =0A>>> i h= ave a problem with setting multiple IPs in the same network in FreeBSD:=0A>= >> =0A>>> - suppose I assign two new IP addresses in the same network to et= h0 with ifconfig:=0A>>> #ifconfig eth0 add 192.168.10.1/24=0A>>> #ifconfig = eth0 add 192.168.10.2/24=0A>>> =0A>>> - everything works fine and the outpu= t of "netstat -r" is like what it should be:=0A>>> #netstat -r=0A>>> ....= =0A>>> 192.168.10.0=A0 eth0=0A>>> 192.168.10.1=A0 =A0 lo0=0A>>> 192.168.10= .2=A0 =A0 lo0=0A>>> ...=0A>>> =0A>>>=0A- but now if I delete first IP addre= ss, connection to 192.168.10.0=0Anetwork will be gone. and in output of "ne= tstat -r" the route to=0A192.168.10.0 (via eth0) is gone:=0A>>> #ifconfig e= th0 delete 192.168.10.1=0A>>> =0A>>> #netstat -r=0A>>> ....=0A>>> =0A>>> 19= 2.168.10.2=A0 =A0 lo0=0A>>> .....=0A>>> =0A>>>=0A- am i missing something h= ere? shouldn't the route to the network=0Aremain in routing table (because = we still have 192.168.10.2 assigned to=0Ainterface)?=0A>>> =0A>>> Thanks.= =0A>>> =0A>> =0A>> You shouldn't assign your secondary IP with a /24 mask, = use /32.=0A>> =0A>> You'll run into problems otherwise.=0A>> =0A>> As a rul= e of thumb, your aliases =3D /32=0A>> =0A=0A> What=0Ayou are doing should w= ork fine.=A0 There were a handful of routing table=0Abugs fixed in the last= few months that corrected this behavior.=A0 The=0Alast =0A> two were just = merged to stable/8 yesterday.=A0 What release are you=0Arunning? =0A=0Athan= k you all for your replies.=0A=0ASorry I dont understand why i shouldn't be= able to assign 2 IP addresses in the same net, can someone tell me why it = shouldn't be possible (if it really shouldn't)? because in my head, it seem= s normal :-)=0Abut even if i don't have to, shouldn't `ifconfig` at least s= how a warning or error message to prevent such things? because now it more = seems like a bug. it successfully assigns 2 (or more) IPs in the same netwo= rk (and it works fine for all of them) but then when you happen to delete o= ne of them, everything goes down.=0A=0AI have FreeBSD-8.2 amd64.