From owner-freebsd-stable@FreeBSD.ORG Fri Feb 25 07:32:44 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD1E106566B for ; Fri, 25 Feb 2011 07:32:44 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta08.emeryville.ca.mail.comcast.net (qmta08.emeryville.ca.mail.comcast.net [76.96.30.80]) by mx1.freebsd.org (Postfix) with ESMTP id 1BDF98FC14 for ; Fri, 25 Feb 2011 07:32:43 +0000 (UTC) Received: from omta17.emeryville.ca.mail.comcast.net ([76.96.30.73]) by qmta08.emeryville.ca.mail.comcast.net with comcast id C7Wt1g0031afHeLA87Yjsy; Fri, 25 Feb 2011 07:32:43 +0000 Received: from koitsu.dyndns.org ([98.248.33.18]) by omta17.emeryville.ca.mail.comcast.net with comcast id C7Yi1g0030PUQVN8d7YikH; Fri, 25 Feb 2011 07:32:43 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 5ABF49B422; Thu, 24 Feb 2011 23:32:42 -0800 (PST) Date: Thu, 24 Feb 2011 23:32:42 -0800 From: Jeremy Chadwick To: Zhihao Yuan Message-ID: <20110225073242.GA95375@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD-STABLE Mailing List Subject: Re: How to bind a static ether address to bridge? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2011 07:32:44 -0000 On Fri, Feb 25, 2011 at 12:56:55AM -0600, Zhihao Yuan wrote: > My server is behind a DHCP-enabled router, and it has two network > interfaces, wlan0 and bge0. I want to use them together, so I bind > them, plus tap0 to bridge0. But bridge has a random MAC address for > each time it was created, which makes me hard to reserve an IP for it > (since I need to forward some ports to this server). So I set > net.link.bridge.inherit_mac=1, which makes bridge0 to use bge0's MAC > address, always. But this causes another problem: the packets sent to > bridge0 is also sent to bge0, -- the packets are duplicated! The > kernel have to drop half of them. So how can I bind a distinct MAC > address to a bridge? I'm not trying to divert you from what you're trying to solve, but can you accomplish what you need without use of bridge(4)? I ask this because I just set up a home NAT router of my own which has 3 interfaces on it: em0 (WAN/connects to cable modem), em1 (LAN), and ath0/wlan0 (for wireless). I *explicitly* chose not to use bridge(4) because of the MAC address complications, and instead use two separate private networks (192.168.1.0/24 for em1 and 192.168.200.0/24 for wlan0). This works without any hitches, no MAC issues, etc.. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |