From owner-freebsd-hackers Sat Jun 22 13:27:53 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA07073 for hackers-outgoing; Sat, 22 Jun 1996 13:27:53 -0700 (PDT) Received: from ns2.harborcom.net (root@ns2.harborcom.net [206.158.4.4]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA07064 for ; Sat, 22 Jun 1996 13:27:48 -0700 (PDT) Received: from swoosh.dunn.org (swoosh.dunn.org [206.158.7.243]) by ns2.harborcom.net (8.7.4/8.6.12) with SMTP id QAA11892; Sat, 22 Jun 1996 16:26:27 -0400 (EDT) Message-Id: <199606222026.QAA11892@ns2.harborcom.net> Comments: Authenticated sender is From: "Bradley Dunn" Organization: Harbor Communications To: Martin Fredriksson Date: Sat, 22 Jun 1996 16:22:08 -0500 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: ifconfig alias (once again...)? Reply-to: dunn@harborcom.net CC: freebsd-hackers@FreeBSD.org Priority: normal X-mailer: Pegasus Mail for Win32 (v2.31) Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk What I do on our web server, which has an entire /24 aliased to it, is: ifconfig lo0 alias xxx.xxx.xxx.xxx I have a file called /usr/local/etc/virtual that has all 254 of these ifconfig commands for each address in this /24. From rc.local I do a: sh /usr/local/etc/virtual and that does it fine. The aliases have to be set up before the web server starts, of course. I start Apache on the next line in rc.local. I know this isn't the "official" way to do it, but it works. Note that my setup has all of the aliases on a different subnet than the physically connected one. Then I added a static route to my default gateway that sends all pakcets for the aliased net to the ethernet interface of the machine doing the aliasing. Works flawlessly. I would definitely recommend putting the aliases on lo0 and on a different subnet. It seems to eliminate any arp, udp, etc. troubles. Just don't forget to add the route! On 22 Jun 96 at 21:50, Martin Fredriksson wrote: > I've tried to make sense out of a lot of posts about ifconfig > aliases, UDP problem, etc, but cannot seem to fit all the pieces > together. Thus following questions. I run FreeBSD 2.1.0, and I need > >2 IP addresses for one machine (all addresses on same subnet). > > (1) Why is it recommended to use netmask 0xffffffff for alias (local > subnet)? > > I have found it possible to use the "real" netmask for the alias > also (it does complain "ioctl (SIOCAIFADDR): File exists", but > everything seems to work ok anyway). > > # ifconfig xx0 192.168.1.228 netmask 0xfffffff0 > # ifconfig xx0 192.168.1.229 netmask 0xfffffff0 alias > > The advantage of doing this is that the UDP bug doesn't happen(?). > > (2) Was any progress made on the UDP bug (alias recognized as > broadcast?)? > > The UDP bug (resulting, for example, in 2 ns replies to 1 query (if > query to alias)) seems to only happen when when using mask > 0xffffffff. > > (3) Any consensus as to where to put the ifconfig alias definition? > Or maybe modify ifconfig, allowing aliases to be specified on the > same line as main address? Bradley Dunn