*BSD News Article 55325


Return to BSD News archive

Newsgroups: comp.unix.bsd.bsdi.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!metrics.com!tomh
From: tomh@metrics.com (Tom Haapanen)
Subject: Re: ifconfig alias command???
Organization: Software Metrics Inc.
Message-ID: <DI932r.9JF@metrics.com>
References: <Pine.OSF.3.91.951113190701.27487B-100000@hubble.sheridanc.on.ca>
Date: Sat, 18 Nov 1995 17:54:27 GMT
Lines: 41

john andy bain <bainjohn@hubble.sheridanc.on.ca> writes:
> I am trying to run multiple www domains on the same server.
> I have downloaded apache, and I used the ifconfig command to setup an alias
> IP address for the same ethernet card.
> It seemed to work, but I cannot ping or telnet to the alias address.
> Ping and telnet works with the original address.

From our /etc/netstart:

    # Hardcoded interface configuration
    echo -n "."
    ifconfig we0 down
    ifconfig we0 inet 198.133.164.1   link0
    for i in $aliases ; do
	echo -n "."
	ifconfig we0 inet 198.133.164.$i alias 2>/dev/null
    done
    ifconfig we0 up
    echo "."

    # configure localhost (loopback) interface
    ifconfig lo0 inet 127.1

    # do not send packets to the "loopback" net off-machine
    route add -net 127 127.1 -reject

    if [ X$defroute != X ]; then
	    route add default $defroute
    fi

    # Add routes to aliases through the loopback address (why?)
    for i in $aliases ; do
	echo -n "."
	route add 198.133.164.$i $loopback >/dev/null
    done
    echo "."


-- 
[ /tom haapanen -- tomh@metrics.com -- software metrics inc -- waterloo, ont ]
[ "plato is dear to me, but dearer still is truth"              -- aristotle ]