From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 09:21:25 2004 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 B69B216A4CE for ; Mon, 26 Jan 2004 09:21:25 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2EAF443D3F for ; Mon, 26 Jan 2004 09:21:20 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i0QHLEjc002841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Jan 2004 17:21:14 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i0QHLErd002840; Mon, 26 Jan 2004 17:21:14 GMT (envelope-from matthew) Date: Mon, 26 Jan 2004 17:21:14 +0000 From: Matthew Seaman To: Mike Message-ID: <20040126172114.GA48421@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Mike , freebsd-questions References: <401542F2.8000309@pacbell.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <401542F2.8000309@pacbell.net> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions Subject: Re: Configuring IP address aliasing 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: Mon, 26 Jan 2004 17:21:25 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 26, 2004 at 08:40:18AM -0800, Mike wrote: > QUESTION: Why do I use a different netmask (255.255.255.255) for a IP=20 > alias on FreeBSD? Why isn't 255.255.255.0 used? It's all about routing of outgoing packets. Unlike linux, you can't use the route(8) command to set up a route to a directly attached network. All of the local routing is controlled through ifconfig(8) -- when you run: # ifconfig fxp0 inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0= =2E255 up amongst other things, that establishes that interface as the route to the 192.168.0.0/24 network. It also says that the source address on packets sent out of that interface will be 192.168.0.1 Now suppose you add an alias address on the same subnet: # ifconfig fxp0 add 192.168.0.2 netmask 0xffffffff broadcast 192.168.0.= 255 Since the netmask is a /32 it says this interface is the route to the specific single address. It also means that the 192.168.0.2 address is only used on outgoing packets from connections directly to the alias address. That's a bit of a simplification, as one of the principle uses for alias addresses is to support jail(8)ed processes, but it holds in general. Could FreeBSD use exactly the same semantics as Linux or Solaris -- yes, sure. But the FreeBSD way gives you a tad more control, and to be honest, it's the way it is mostly because the people who wrote the code thought that was the way it should be. =20 Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAFUyKdtESqEQa7a0RApKhAJ9BMI4md4Hz5S5kddZdYdmnOvHe8gCdFBH/ hJN74gj67Z8PQNwBIoOsXqQ= =odVz -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM--