Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Feb 2012 21:06:26 -0800 (PST)
From:      "M. V." <bored_to_death85@yahoo.com>
To:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Assigning multiple IPs in the same network to an interface
Message-ID:  <1329541586.68159.YahooMailNeo@web162203.mail.bf1.yahoo.com>
In-Reply-To: <37B92AD6-F745-4D26-A924-271476558D93@averesystems.com>
References:  <1329376106.7683.YahooMailNeo@web162203.mail.bf1.yahoo.com> <4F3D0197.60100@my.gd> <37B92AD6-F745-4D26-A924-271476558D93@averesystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
=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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1329541586.68159.YahooMailNeo>