Subject: Re: tech-net : ifconfig and aliases
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Jens A Nilsson <jnilsson@ludd.luth.se>
List: tech-net
Date: 07/19/1999 17:29:41
Darren Reed <darrenr@reed.wattle.id.au>,wrote on Jul 20, 1999 at 00:54 +1000: 
> Today I had the unfortunate displeasure of discovering how IP aliases
> attempt to work within NetBSD.  I'm not sure where the problems actually
> are, yet, but this is an extract of my experiences:
Are we talking about NetBSD 1.4 here?

> 
> - configuring aliases for interfaces.  The method `supported' by netstart
>   is unsatisfactory if you wish to configure more than one interface.
> 
> - the method suggested in netstart for setting the netmask does not work.
>   If I have an interface setup as 192.168.1.1/29 and add an alias, the
>   netmask does not appear to be applied, instead a /24 (class C) netmask
>   is applied to the alias.  Perhaps ifconfig should do a `head -1' of
>   /etc/ifconfig.ifname to set initial options with a loop processing the
>   rest of the file (if any).
This is what I have in my rc.conf and it works as expected:
ifconfig_de1="130.240.192.230 netmask 0xffff0000 media 100baseTX"
ifaliases_de1="10.0.0.230 0xffffff00"

As I understand it you use /etc/ifaliases could you please show
it, or relevant parts of it?

> 
> - when setting an IP address alias on an interface where the IP number
>   falls inside the network for the interface, ifconfig prints out an
>   error ("ifconfig: SIOCAIFADDR: File exists") but sets it up anyway.
It's a bug in ioctl SIOCAIFADDR that it sets it up anyway. What
you should have specified is a netmask with all bits set (0xffffffff)
if you have two IP addesses in the the same address space and
identical netmasks.

> 
> - ifconfig should be capable of setting netmasks without needing the
>   "inet" portion of the command line syntax present.
I don't understand "ifconfig lo0 127.0.0.1 netmask 0xffff0000"
changes the netmask correctly.

> 
> How much of the above is deliberate and if it is, can I bite those who
> decreed that it should be that way ? >:>
> 
> Cheers,
> Darren

-- 
mvh Jens

NetBSD - Serious Other, or Serious Operating system. Your choice.