Date: Sat, 22 Jun 1996 16:22:08 -0500 From: "Bradley Dunn" <dunn@harborcom.net> To: Martin Fredriksson <martin@msp.se> Cc: freebsd-hackers@FreeBSD.org Subject: Re: ifconfig alias (once again...)? Message-ID: <199606222026.QAA11892@ns2.harborcom.net>
next in thread | raw e-mail | index | archive | help
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 <dunn@harborcom.net>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606222026.QAA11892>