From owner-freebsd-net@FreeBSD.ORG Mon Oct 23 09:47:06 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 E24A516A415 for ; Mon, 23 Oct 2006 09:47:06 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp1-g19.free.fr (smtp1-g19.free.fr [212.27.42.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B58343D4C for ; Mon, 23 Oct 2006 09:47:06 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp1-g19.free.fr (Postfix) with ESMTP id 4AD6C5123; Mon, 23 Oct 2006 11:47:05 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id 220359E6C6; Mon, 23 Oct 2006 09:47:43 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id 0BC71405F; Mon, 23 Oct 2006 11:47:43 +0200 (CEST) Date: Mon, 23 Oct 2006 11:47:42 +0200 From: Jeremie Le Hen To: Raymond Wagner Message-ID: <20061023094742.GA53114@obiwan.tataz.chchile.org> References: <20061016061255.CNQK10743.gx6.fuse.net@raymond2> <20061022160103.GX53114@obiwan.tataz.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061022160103.GX53114@obiwan.tataz.chchile.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-net@freebsd.org Subject: Re: Virtual Network Interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2006 09:47:07 -0000 Raymond, On Sun, Oct 22, 2006 at 06:01:03PM +0200, Jeremie Le Hen wrote: > On Mon, Oct 16, 2006 at 02:12:47AM -0400, Raymond Wagner wrote: > > My ISP provides me up to 5 dynamically assigned addresses out of a /20 > > block. I have more than 5 machines on my network, so I have no choice but > > to run NAT, however I would like to force two of those machines onto their > > own external addresses. If I had static addresses, I could simply alias the > > addresses into the external interface and then use "binat" in pf to redirect > > the traffic. However, the addresses have to be requested from the DHCP > > server, and expire after 4 hours. > > > > I can get this to work by running the NAT function under QEMU and just > > giving the virtual machine several interfaces bridged to the physical > > external interface. Running a VM is far from ideal. Is there any way I > > could set up a virtual network interface that could be bridged to the true > > interface and grab its own DHCP address? > > I don't know if that works, but I would try the following setup. > Supposing you have two physical interaces, an external one (ext0) > and an internal one (int0), I would create a VLAN on int0 for > each machine which have to have its own public address (vlan1 > and vlan2) and bridge { ext0, vlan1, vlan2 }. I thought of another way this morning in my bathroom, which is far neater, though I've not tested it. First use if_bridge(4) to mingle ext0 and int0, then use the MAC addresses to let through but the machines that are supposed to have a public IP address; the other will have to use your FreeBSD as a default gateway. Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >