From owner-freebsd-isp Tue Jan 9 15:10: 6 2001 Delivered-To: freebsd-isp@freebsd.org Received: from orion.psknet.com (mail.psknet.com [63.171.251.4]) by hub.freebsd.org (Postfix) with SMTP id 3DB3937B404 for ; Tue, 9 Jan 2001 15:09:43 -0800 (PST) Received: (qmail 30218 invoked from network); 9 Jan 2001 23:09:42 -0000 Received: from arcadia.psknet.com (HELO arcadia) (63.171.251.7) by mail.psknet.com with SMTP; 9 Jan 2001 23:09:42 -0000 From: "Troy Settle" To: "Colin Campbell" Cc: Subject: RE: Hosting with multiple subnets Date: Tue, 9 Jan 2001 18:09:24 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: Importance: Normal Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Colin, I'm breaking netiqet by copying this back to the list, but I think that many folks will find this useful or even educational. You are correct, in that on a /26 subnet, you only have 62 usable IP addresses, however, if you treat it as a group of 64 /32 subnets, you can use all 64 addresses in the /26 that you allocated for web hosting. The same thing applies to dynamic IP pools on your NAS. Keep in mind, though, that this does not work if you are not properly subnetted. If the subnet on your LAN is a /24, you can not use the network or broadcast addresses. If, however, you use the first /26 (0-31) for your LAN, then route the last /26 (192-255) to your web server at .10, you can treat all 64 addresses in 192/26 as /32 subnets, giving you use of all 64 addresses (including .255). This concept does extend to a /24. If you treat it as a group of 256 /32 subnets, you can use all 256 addresses for web hosting or dialup. It works for /any/ size CIDR block of IP addresses. Give me a /16, and I'll give you 65,536 usable addresses for web hosting. -- Troy Settle Pulaski Networks 540.994.4254 It's always a long day, 86400 doesn't fit into a short ** -----Original Message----- ** From: Colin Campbell [mailto:sgcccdc@citec.qld.gov.au] ** Sent: Tuesday, January 09, 2001 5:38 PM ** To: Troy Settle ** Subject: RE: Hosting with multiple subnets ** ** ** Hi, ** ** On Tue, 9 Jan 2001, Troy Settle wrote: ** ** > Agreed, but you could have given an example of one of the good ** ways to do ** > it. Here's how I set up for hosting: ** > ** > 192.168.10.1/26 - gw address ** > 192.168.10.8/26 - fxp0 on my web server ** > 192.168.20.0/23 - bound to lo1 on the web server ** > ** > I use zebra to implement OSPF to get the routes kicked around ** my network, ** > but it could easily be done with a static route on the gateway router. ** > ** > Doing it like this keeps the arp tables small. I don't know ** if it really ** > matters or not, but I like it like that. ** > ** > I also use a script rather than rc.conf to do my bindings: ** > ** > for i in `jot 256 0` ** > do ifconfig lo1 inet 192.168.20.${i} netmask 0xffffffff alias ** > done ** > ** > And, yes, I do bind the /whole/ subnet. I won't use .0 or ** .255, but with a ** > /26, I will use all 64 addresses. ** ** You cannot use ALL addresses in a subnet. A /26 gives you 62 usable ** addresses. The host address that is all 0's is the sub-network ** address and ** the host address that is all 1's is the broadcast address. With ** a /26 mask ** you have four subnets as follows: ** ** Subnet 1 ** -------- ** 192.168.10.0 = network address ** 192.168.10.1-192.168.10.62 = usable host addresses ** 192.168.10.63 = broadcast ** ** Subnet 2 ** -------- ** 192.168.10.64 = network address ** 192.168.10.65-192.168.10.126 = usable host addresses ** 192.168.10.127 = broadcast ** ** Subnet 3 ** -------- ** 192.168.10.128 = network address ** 192.168.10.129-192.168.10.190 = usable host addresses ** 192.168.10.191 = broadcast ** ** Subnet 4 ** -------- ** 192.168.10.192 = network address ** 192.168.10.193-192.168.10.254 = usable host addresses ** 192.168.10.255 = broadcast ** ** Colin ** ** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message