two public ip addresses on one interface

Eygene Ryabinkin rea-fbsd at codelabs.ru
Mon May 28 07:43:29 UTC 2007


Alex, good day.

Sun, May 27, 2007 at 07:07:41PM +0800, Wilkinson, Alex wrote:
>     > If your aliases are part of the same subnet as the "primary" or first configured IP, then you want to 
>     > use the all-1's netmask.  In your case, however, the second IP is part of a completely different subnet, 
>     > and you can (and should) use a /24 netmask....
> 
> I have always wondered why we need to use the "all-1's" netmask. Why is this ?

Because if you're stuffing two addresses from the same subnet to
one interface it will not work: there can be only one route to the
specified network in the FreeBSD routing table.  And adding IP to
the interface creates the entry in the routing table.  So you should
specify the different mask and most probably 0xffffffff will be the
best choice, but your mileage may vary with your routing needs.
-- 
Eygene


More information about the freebsd-net mailing list