Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2001 05:12:25 +0100 (CET)
From:      Luigi Rizzo <luigi@info.iet.unipi.it>
To:        Matthew Emmerton <matt@gsicomp.on.ca>
Cc:        Josef Karthauser <joe@tao.org.uk>, "Rogier R. Mulhuijzen" <drwilco@drwilco.nl>, Jonathan Graehl <jonathan@graehl.org>, freebsd-net@FreeBSD.ORG
Subject:   Re: Quick question about IP aliasing
Message-ID:  <200102280412.FAA30065@info.iet.unipi.it>
In-Reply-To: <007901c0a13a$b4480dd0$1200a8c0@gsicomp.on.ca> from Matthew Emmerton at "Feb 27, 2001 10:58:15 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > > On Tue, Feb 27, 2001 at 07:16:14AM +0100, Rogier R. Mulhuijzen wrote:
> > > >
> > > > > [ Matt Emmerton wrote: ]
> > > > >The point is that you need to use a netmask of 255.255.255.255 for
> aliased
> > > > >IPs on FreeBSD, regardless of the alias of the primary (non-alias)
> IP.
> >
> > no this is incorrect. you just have to make sure that the aliased
> > IP&mask do not generate info which is already in the routing table.
> > E.g. if your primary addr is 1.2.3.4/24 , an alias of 1.2.3.5/24 will
> > give a warning, but an alias of 1.2.4.4/24 will not, and most likely even
> > 1.2.3.5/25 will not.
> 
> I'm just reiterating what I was told 1.5 years ago when I complained that
> the following setup wouldn't work:
> 
> Primary IP:  192.168.0.1/255.255.255.0
> Aliased IP:  192.168.0.10/255.255.255.0
> 
> With this setup, I could not ping, traceroute or connect to the aliased IP.
> In order to make the aliased IP functional, I had to use a netmask of
> 255.255.255.255 -- a fact which I find totally confusing and
> counter-intuitive, but one that seems to work.

the source of confusion is just the fact that when you ifconfig an
interface, you really give two distinct pieces of information:
 1. an ip address that the machine recognises as its own
 2. an address for a subnet connected to that interface.
With aliases you can assign multiple instances of 1 and 2, as long
as they are distinct. In your example the subnet address that
you try to set with the alias is the same as the one you have
already set with the primary ip, so the info is already there and
you get the warning/error.

> > > > Everybody is saying use 255.255.255.255 for an alias. Noone is giving
> > > > reasons why.
> 
> Exactly.  I never got a good answer to this when I first stumbled upon it,
> and I still haven't.  All I know is that this is the way it needs to be done
> in order for things to work properly.

the reason is above.

	cheers
	luigi
----------------------------------+-----------------------------------------
 Luigi RIZZO, luigi@iet.unipi.it  . ACIRI/ICSI (on leave from Univ. di Pisa)
 http://www.iet.unipi.it/~luigi/  . 1947 Center St, Berkeley CA 94704
 Phone (510) 666 2927             .
----------------------------------+-----------------------------------------

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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