From owner-freebsd-questions Fri Feb 21 10:24: 0 2003 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 27A4837B401 for ; Fri, 21 Feb 2003 10:23:57 -0800 (PST) Received: from apollo.laserfence.net (apollo.laserfence.net [196.44.69.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A61843FCB for ; Fri, 21 Feb 2003 10:23:54 -0800 (PST) (envelope-from will@unfoldings.net) Received: from localhost ([127.0.0.1]) by apollo.laserfence.net with esmtp (Exim 4.10) id 18mHpr-000ExX-00; Fri, 21 Feb 2003 20:23:47 +0200 Received: from prometheus-p0.datel.laserfence.net ([192.168.255.1] helo=prometheus.home.laserfence.net) by apollo.laserfence.net with esmtp (Exim 4.10) id 18mHpW-000ExH-00; Fri, 21 Feb 2003 20:23:28 +0200 Received: from phoenix.home.laserfence.net ([192.168.0.2]) by prometheus.home.laserfence.net with esmtp (Exim 4.10) id 18mHpR-000AkI-00; Fri, 21 Feb 2003 20:23:21 +0200 Received: from will by phoenix.home.laserfence.net with local (Exim 4.10) id 18mHpP-0002Zk-00; Fri, 21 Feb 2003 20:23:19 +0200 From: Willie Viljoen To: Mark Subject: Netmasks for aliases (was Re: Bizarre Networking Problem) Date: Fri, 21 Feb 2003 20:23:19 +0200 User-Agent: KMail/1.5 References: <27.39e39215.2b869c70@aol.com> <20030221105259.Y87091@pcjfn.msc.com> <200302211717.H1LHHH4X003458@asarian-host.net> In-Reply-To: <200302211717.H1LHHH4X003458@asarian-host.net> Cc: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200302212023.19708.will@unfoldings.net> X-Spam-Score: (/) X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *18mHpW-000ExH-00*C7X6np3FR3A* X-Virus-Scanned: by AMaViS snapshot-20020422 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Friday 21 February 2003 19:17, Mark wrote: > > > > /sbin/ifconfig xl0 192.246.38.10 netmask 255.255.255.0 > > /sbin/ifconfig xl0 alias 208.23.240.10 netmask 255.255.255.0 > > Hmm, I thought aliases always needed to have netmask of 255.255.255.255. > Has something changed? > > - Mark Mark, Aliases on the same subnet should always be 255.255.255.255, this does not apply where they are on different subnets, however. Here is a good example, from the ifconfig output of a mail server I set up at an ISP in a nearby town. They used to use a private range, but have since added a public class C which has been broken up into smaller ranges for routing. The mail server, for legacy reasons, still has to serve people on the old IPs because those are still being used by machines in their office, and reconfiguring every office machine with new server IP addresses (they didn't have internal DNS then) would be wasting time. We didn't want to waste public IPs on beancounters, so we just left their machines as is. The host is also serving on the new IP, and acting as a POP server for several virtual domains, which have aliases. The 10.0.1.0/24 range (their office), and the 196.38.113.0/27 range (used for their server farm + virtual domains) are still the same physical network though. The output from ifconfig follows: %ifconfig dc0: flags=8843 mtu 1500 inet 196.38.113.2 netmask 0xffffffe0 broadcast 196.38.113.31 inet6 fe80::a00:8ff:fe00:800%dc0 prefixlen 64 scopeid 0x1 inet 196.38.113.3 netmask 0xffffffff broadcast 196.38.113.3 inet 196.38.113.5 netmask 0xffffffff broadcast 196.38.113.5 inet 196.38.113.6 netmask 0xffffffff broadcast 196.38.113.6 inet 196.38.113.7 netmask 0xffffffff broadcast 196.38.113.7 inet 196.38.113.8 netmask 0xffffffff broadcast 196.38.113.8 inet 196.38.113.9 netmask 0xffffffff broadcast 196.38.113.9 inet 196.38.113.10 netmask 0xffffffff broadcast 196.38.113.10 inet 196.38.113.11 netmask 0xffffffff broadcast 196.38.113.11 inet 10.0.1.4 netmask 0xffffff00 broadcast 10.0.1.255 inet 10.0.1.5 netmask 0xffffffff broadcast 10.0.1.5 ether 08:00:08:00:08:00 media: Ethernet autoselect (100baseTX ) status: active lo0: flags=8049 mtu 16384 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 Note how 196.38.113.2 (the machine's real address) has a netmask of 0xffffffe0, or 255.255.255.224, and the other addresses in this range (all of them aliases) have 0xffffffff, 255.255.255.255. Then look at 10.0.1.4, which is an alias too. It has a netmask of 0xffffff00, or 255.255.255.0. Now look at 10.0.1.5, an alias used for serving intranet web content to legacy machines. Again, a netmask of 0xffffffff. The reason for this is that 10.0.1.4, even though being an alias, is the first address the machine handles on that subnet. Just as 196.38.113.2 is the first address the machine has on the public subnet. Rule of thumb: First address on a subnet, alias or not, has the proper subnet netmask. Every other address on the subnet following that, has 0xffffffff, or 255.255.255.255. Will > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Willie Viljoen Freelance IT Consultant 214 Paul Kruger Avenue, Universitas Bloemfontein 9321 South Africa +27 51 522 15 60 +27 51 522 44 36 (after hours) +27 82 404 03 27 (mobile) will@unfoldings.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message