Subject: ifconfig alias (solution)
To: None <current-users@NetBSD.ORG>
From: Randy Terbush <randy@zyzzyva.com>
List: current-users
Date: 11/14/1995 08:03:18
Yet another which did not make it to the list....


------- Forwarded Message

To: current-users@netbsd.org
Subject: ifconfig alias (solution)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Sat, 11 Nov 1995 09:57:53 -0600
From: Randy Terbush <randy@zyzzyva.com>

Getting longer and longer between reboots, so this thread from a
few weeks back may have been somewhat lost. However, none of the
suggested solutions worked as advertised. I share the solution
that is working for me below. The initial suggested change is
from Perry Metzger(sp?) below. (if memory serves) Note that I
*must* point to the loO device in order for this to work. ??


>From /etc/netstart:

# /etc/hostaliases, if it exists, contains the names of additional ip
# addresses for each interface. It is formatted as a series of lines
# that contain
# interface address
if [ -f /etc/hostaliases ]; then
(
    set -- `cat /etc/hostaliases`

    while [ $# -ge 2 ] ; do
    ifconfig $1 inet alias $2 netmask 255.255.255.0
    route add $2 localhost 
        shift 2
    done
 )
fi


>From /etc/hostaliases:

lo0 198.183.2.200
lo0 198.183.2.201
lo0 198.183.2.202






------- End of Forwarded Message