Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Feb 2012 11:39:27 +0100
From:      Damien Fleuriot <ml@my.gd>
To:        Andrew Boyer <aboyer@averesystems.com>
Cc:        freebsd-net@freebsd.org, "M. V." <bored_to_death85@yahoo.com>
Subject:   Re: Assigning multiple IPs in the same network to an interface
Message-ID:  <4F3F7FDF.8060202@my.gd>
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


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 ?




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