From owner-freebsd-net@FreeBSD.ORG Wed Aug 27 19:43:08 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F4F816A4BF for ; Wed, 27 Aug 2003 19:43:08 -0700 (PDT) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B57444005 for ; Wed, 27 Aug 2003 19:43:06 -0700 (PDT) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (on@banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.12.3/8.9.3) with ESMTP id h7S2h14t089777 for ; Thu, 28 Aug 2003 09:43:03 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.8.5/8.8.5) id JAA19927; Thu, 28 Aug 2003 09:45:09 +0700 (ICT) Date: Thu, 28 Aug 2003 09:45:09 +0700 (ICT) Message-Id: <200308280245.JAA19927@banyan.cs.ait.ac.th> X-Authentication-Warning: banyan.cs.ait.ac.th: on set sender to on@banyan.cs.ait.ac.th using -f From: Olivier Nicole To: freebsd-net@freebsd.org In-reply-to: <3F4D0968.5050800@tcoip.com.br> (dcs@tcoip.com.br) References: <3F4CBA6A.5AA7DEB0@cvt.dk> <3F4D0968.5050800@tcoip.com.br> X-Virus-Scanned: by amavisd-milter (http://amavis.org/) Subject: Re: subnetting C class into /26 /25 /26, why can this be done? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2003 02:43:08 -0000 Christoffer Pio wrote: > Is it not possible to subnet a C class into 3 nets, like > > 0-63 > 64-191 <-- Offending network (?) > 192-255 > > If so, why is this? I think you got explanations on the why. Now it should still be possible to subnet the way you want I think. While I would never recommend it, think routing should go with the most significant mask for a given address. So if you subnet: 1) x.x.x.0/26 2) x.x.x.192/26 3) x.x.x.0/24 you should be able to do the trick. An address in the range 0-63 will match both mask 1) and 3) but mask 1) is most significant (more bits, higer value) so the packet will be routed to subnet 1). Same thing for a packet in the range 192-255, with subnet 2) and 3), it will be router to subnet 2). And a packet in the range 64-191 will only match the subnet 3) so it will go to the subnet 3). IF I AM NOT WRONG, this should work, but it is definitely nasty. If you absolutely need 2 subnets of 64 addresses and one of 128, doing: 1) x.x.x.0/26 2) x.x.x.64/26 3) x.x.x.128/25 is nicer and will result in the ranges 0-64, 64-127 and 128-255. Olivier