From owner-freebsd-questions@FreeBSD.ORG Tue Apr 29 10:38:45 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 273A837B404 for ; Tue, 29 Apr 2003 10:38:45 -0700 (PDT) Received: from server.sirtis.org.uk (dsl-217-155-170-59.zen.co.uk [217.155.170.59]) by mx1.FreeBSD.org (Postfix) with SMTP id 155B443F75 for ; Tue, 29 Apr 2003 10:38:43 -0700 (PDT) (envelope-from jonathan@sirtis.org.uk) Received: (qmail 42079 invoked by uid 1006); 29 Apr 2003 17:38:40 -0000 Received: from jonathan@sirtis.org.uk by server.sirtis.org.uk by uid 1011 with qmail-scanner-1.15 spamassassin: 2.43. Clear:SA:0(0.3/5.0):. Processed in 1.487403 secs); 29 Apr 2003 17:38:40 -0000 X-Spam-Status: No, hits=0.3 required=5.0 Received: from unknown (HELO workstation) (webmail@sirtis.org.uk@217.155.170.58) by 0 with SMTP; 29 Apr 2003 17:38:38 -0000 From: "Jonathan" To: "'Steve Warwick'" , Date: Tue, 29 Apr 2003 18:39:09 +0100 Message-ID: <002f01c30e76$3d9bdb20$3aaa9bd9@workstation> 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, Build 10.0.2627 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Subject: RE: Netmasks: the truth is out there? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2003 17:38:45 -0000 -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Steve Warwick Sent: 29 April 2003 18:03 To: freebsd-questions@FreeBSD.ORG Subject: Netmasks: the truth is out there? Hi All, I know someone out there knows the truth about netmasks. All the documentation I can find on the net talks about "masking off" part of the IP address and how you can tell network from subnet and host ids. However, I have knowledgeable friend who is telling me that the netmask is also dependant on how the hosting company has set up their routing tables and incorrect netmasking on my part can reduce or halt my connection. So the question is, who is right? Is it as simple as just masking off the first three octets or does the netmask interact with the router? -----End of Original Message----- Hi Steve, They are both correct... Masking off the first three octets implies that the network address is contained with those three octets and the network interfaces within are addressed using the remaining octet. There's a nice port called whatmask (/usr/ports/net/whatmask) which will show you examples of how different netmasks are used. I, for instance, get given 8 IPs by my provider, so my netmask is 255.255.255.248. So, for the netmark you talk of (3 octets) you would see something like: su-2.05a# whatmask 192.168.0.1/24 ------------------------------------------------ TCP/IP NETWORK INFORMATION ------------------------------------------------ IP Entered = ..................: 192.168.0.1 CIDR = ........................: /24 Netmask = .....................: 255.255.255.0 Wildcard Bits = ...............: 0.0.0.255 ------------------------------------------------ Network Address = .............: 192.168.0.0 Broadcast Address = ...........: 192.168.0.255 Usable IP Addresses = .........: 254 First Usable IP Address = .....: 192.168.0.1 Last Usable IP Address = ......: 192.168.0.254 For 8 IPs, like my setup... su-2.05a# whatmask 192.168.0.1/29 ------------------------------------------------ TCP/IP NETWORK INFORMATION ------------------------------------------------ IP Entered = ..................: 192.168.0.1 CIDR = ........................: /29 Netmask = .....................: 255.255.255.248 Wildcard Bits = ...............: 0.0.0.7 ------------------------------------------------ Network Address = .............: 192.168.0.0 Broadcast Address = ...........: 192.168.0.7 Usable IP Addresses = .........: 6 First Usable IP Address = .....: 192.168.0.1 Last Usable IP Address = ......: 192.168.0.6 What you need to do is ask your provider what the size of the network is for your particular setup. There's more information at: http://www.hildrum.com/IPAddress.htm And to answer your specific question - if your router is to control 256 IPs, yes, you use 255.255.255.0 as the netmask. If it's 128, you use 255.255.255.128, 64 = 255.255.255.192 etc etc. I did a Google search for "netmask explanation" - YMMV. HTH, Jonathan