From owner-freebsd-questions Wed May 24 08:20:39 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA14130 for questions-outgoing; Wed, 24 May 1995 08:20:39 -0700 Received: from leo.ibms.sinica.edu.tw ([140.109.40.249]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id IAA14122 for ; Wed, 24 May 1995 08:20:34 -0700 Received: (from taob@localhost) by leo.ibms.sinica.edu.tw (8.6.11/8.6.9) id XAA26041; Wed, 24 May 1995 23:16:13 +0800 Date: Wed, 24 May 1995 23:16:09 +0800 (CST) From: Brian Tao To: Richard A Childers cc: freebsd-questions@FreeBSD.org Subject: Re: How Many IPs Can An Interface Take ? In-Reply-To: <199505241400.HAA10582@netcom19.netcom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: questions-owner@FreeBSD.org Precedence: bulk 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 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 0 0 0 0 0 lo0 16384 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 netmask 0xffffff00 alias route add 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