Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 May 1995 23:16:09 +0800 (CST)
From:      Brian Tao <taob@gate.sinica.edu.tw>
To:        Richard A Childers <pascal@netcom.com>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: How Many IPs Can An Interface Take ?
Message-ID:  <Pine.BSI.3.91.950524222539.21919K-100000@leo>
In-Reply-To: <199505241400.HAA10582@netcom19.netcom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 24 May 1995, Richard A Childers wrote:
> 
> Hmm. Are you sure you didn't sequentially assign 57 separate addresses,
> one after another, to the same device, so that when you were done, you
> left it configured to the IP of the last address you'd ifconfig'd it with ?

    No, it actually does work:

# foreach i (`seq 65 100 1 140.109.40.`)
foreach? ifconfig ed1 inet $d netmask 0xffffff00 alias
foreach? end
ifconfig: ioctl (SIOCAIFADDR): File exists
[repeat 35 times]
# netstat -i
Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs Coll
ed1   1500  <Link>00.00.e8.cb.cd.58      6621403    20  4458601    16 648020
ed1   1500  140.109.40  leo              6621403    20  4458601    16 648020
ed1   1500  140.109.40  140.109.40.65    6621403    20  4458601    16 648020
ed1   1500  140.109.40  140.109.40.66    6621403    20  4458601    16 648020
[...]
ed1   1500  140.109.40  140.109.40.99    6621403    20  4458601    16 648020
ed1   1500  140.109.40  140.109.40.100   6621403    20  4458601    16 648020
lp0*  1500  <Link>                             0     0        0     0 0
lo0   16384 <Link>                           316     0      316     0 0
lo0   16384 your-net    localhost            316     0      316     0 0

    Doing an fping from another host shows that the machine does
indeed respond at all the aliases.

    I think ifconfig is supposed to add in a route for an alias, but
it can't, and I think that's why I get the "ifconfig: ioctl
(SIOCAIFADDR): File exists" error.  So now I do this for each IP I
want to add and be able to access from the localhost:

ifconfig ed1 inet <alias> netmask 0xffffff00 alias
route add <alias> localhost

... which allows you access the alias over the loopback interface.
-- 
Brian ("Though this be madness, yet there is method in't") Tao
taob@gate.sinica.edu.tw <-- work ........ play --> taob@io.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.91.950524222539.21919K-100000>