Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Oct 1999 09:55:15 -0700
From:      Matthew Reimer <mreimer@vpop.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Class C hack instead of ifconfig aliases
Message-ID:  <380DF3F3.E22CFAF8@vpop.net>
References:  <lists.freebsd.hackers.199910201002.LAA12741@beckett.earlsfort.iol.ie> <lists.freebsd.hackers.19991020161308.A75038@chuggalug.clues.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Here's a way to do it without patches:

1. in your webserver:
   a. ipfw add fwd localhost from any to 1.2.3/24 http
   b. add <VirtualHost...> sections, like this:

	<VirtualHost 1.2.3.4>
	    ServerName web.freebsd.org
	    ServerAdmin webmaster@freebsd.org
	    DocumentRoot /home/web
	</VirtualHost>

2. in your router: add a route to forward 1.2.3/24 to your webserver

Pros:

- no need to 'ifconfig xyz alias...'.
- address matching is fast, since only a few ipfw rules are checked,
  rather than lists of hundreds or thousands of IP addresses

Cons:

- I don't think arp will work on 1.2.3/24 addresses, which is why the
route needs to be added to the router.

Try it: it really works, thanks to Julian Elischer.

Matt

Geoff Buckingham wrote:
> 
> On Wed, Oct 20, 1999 at 11:02:08AM +0100, Nick Hilliard wrote:
> > > What do you mean by "bind a class C"?  Make an interface so it will
> > > respond to incoming requests for 10.1.2.x?  ewww, yuck!
> >
> > Is it any less elegant than having in_localaddr() trawling through each item
> > on the address list?  Perhaps 1024 items if you've got a large vweb server?
> > That's also pretty inelegant.
> >
> 
> The patch refered to elsewhere comes from Demon Internet where it was (at least
> in my time) used to two /18s and a /16 without problems, this would have
> been completely impractical through more conventional means.
> 
> As I continue to work with large scale virtual hosting set ups I would quite
> like to see this enter the main source tree, allthough I guess people likely
> to make use of it are a very small minority.
> 
> In an effort to avoid what may follow, I fully appreciate HTTP 1.1 vhosting
> is much more appropriate in many situations, this does not however
> remove the need for large scale conventional virtual hosting alltogether.
> 
> --
> GeoffB
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?380DF3F3.E22CFAF8>