From owner-freebsd-net@FreeBSD.ORG Wed Aug 13 02:26:59 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BED57F7 for ; Wed, 13 Aug 2014 02:26:59 +0000 (UTC) Received: from equinox.hilltopgroup.com (nova.hilltopgroup.com [204.109.63.176]) by mx1.freebsd.org (Postfix) with ESMTP id C9E0428A8 for ; Wed, 13 Aug 2014 02:26:58 +0000 (UTC) Received: from igarinil.com (adsl-072-149-073-165.sip.asm.bellsouth.net [72.149.73.165]) by equinox.hilltopgroup.com (Postfix) with ESMTP id AFF421A3C11 for ; Wed, 13 Aug 2014 02:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=hilltopgroup.com; s=mail; t=1407896815; x=1723123886; q=dns/txt; h=From:Subject: Date:Message-ID:Content-Type:Content-Transfer-Encoding: Content-Language; bh=Hc+zUmIeB3Dtr0ycPT4+MWU6uKm7VsHdzbU1+KgfvIw =; b=CTwgcU4GC1Bn44+EIR5UUs7c+Z7YShwPAE8GbwG+noZh5Yz3T7/133JhvIy PODA5miuWTo4DuNHJNbQJi2TECoeEyWvkyiy+fjc3RvDDNN/mIe+o7yacbuvoWey NhYeAZhFbreZ6TVCtEjavVSPZZjF4stXDX7XxL1t3CqunAZ0= Received: from ([50.167.119.14]) by oberth.igarinil.com with ESMTP with TLS id 0810B00368.10871995; Tue, 12 Aug 2014 22:26:54 -0400 From: "Joseph Ward" To: References: In-Reply-To: Subject: RE: SPAN port doesn't pick up locally generated traffic Date: Tue, 12 Aug 2014 22:27:11 -0400 Message-ID: <08f701cfb69e$1698e2c0$43caa840$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 thread-index: Ac+2a8Sb6s/uTh0eReyVjE5+ZAz03AAMNfZA Content-Language: en-us X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2014 02:26:59 -0000 I found a workaround that is acceptable. First, I want to thank Hiren Panchasara for recommending the work-around that I hadn't thought about trying. For the archives and anyone struggling with the same issue: I altered the setup below by giving the LAN IP to the wired interface re1 as opposed to bridge0. Doing that magically made the span port (re2) get all the traffic, both passing through in re1 and out ath0 (and vice versa) as well as the packets that originate inside the system and are passed to the bridge. This isn't ideal as it means that if the physical interface re1 goes down, clients on ath0 will lose connectivity to the system, and I had always understood that when bridging it's ideal to give the IPs to the bridge itself to protect against that possibility. However, I can give each interface another IP on a different subnet that will at least allow for remote connectivity in that scenario. Does anyone know if this is known/expected behavior? If no one knows I'll file a bug ticket on the scenario as it certainly doesn't seem kosher to me. Thanks everyone, -Joseph -----Original Message----- From: Joseph Ward [mailto:jbward@hilltopgroup.com] Sent: Tuesday, August 12, 2014 4:27 PM To: 'freebsd-net@freebsd.org' Subject: SPAN port doesn't pick up locally generated traffic Hi, I have built a firewall/routing box utilizing FreeBSD and need to mirror all of the lan-side traffic before it is NATed to another box which will have traffic analysis software running on it. The firewall box has 4 interfaces: 3 wired (re0, re1, re2) and 1 wireless (ath0). re0 is the internet port (WAN), re1 and ath0 are bridged into bridge0 which has my LAN IP (so that both my wired and wireless systems are all on the same physical network), and re2 is a member of bridge0 as a SPAN port. A tcpdump on the SPAN (and on the analysis box) shows that all packets which enter the system via ath0 and re1 are mirrored appropriately, but if the packets originate either on the WAN port (re1) or internal to the firewall box (ping a LAN endpoint from the firewall shell) the packets are not present on the SPAN port. tcpdump on bridge0 captures the packets, so they're definitely on the bridge. In order to eliminate all possibilities I ran a liveCD of FreeBSD 10 on a box with 4 interfaces with em0 and em1 bridged together into bridge0 with em3 as a SPAN port for bridge0. No firewall, no ports, nothing has been installed or configured. On this box, any packets which physically enter either em0 or em1 (the bridged interfaces) are SPANned, but nothing that originates on the fresh box shows up on the SPAN. Again, the packets originating on the system show up on a tcpdump of bridge0. I'm not much of a system-level programmer, but it certainly looks as if my expected behavior is "proper" based on if_bridge.c and the comment before "bridge_output" function which definitely has a "bridge_span" call when sending unicast with locally generated traffic which is what I'm doing here. Am I missing something? A configuration variable somewhere perhaps? Or is this a bug somewhere? Any help would be greatly appreciated!