From owner-freebsd-net@FreeBSD.ORG Mon Mar 5 04:51:06 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 175361065674 for ; Mon, 5 Mar 2012 04:51:06 +0000 (UTC) (envelope-from bagadeh@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 89E358FC0A for ; Mon, 5 Mar 2012 04:51:05 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so3777293bkc.13 for ; Sun, 04 Mar 2012 20:51:04 -0800 (PST) Received-SPF: pass (google.com: domain of bagadeh@gmail.com designates 10.204.133.196 as permitted sender) client-ip=10.204.133.196; Authentication-Results: mr.google.com; spf=pass (google.com: domain of bagadeh@gmail.com designates 10.204.133.196 as permitted sender) smtp.mail=bagadeh@gmail.com; dkim=pass header.i=bagadeh@gmail.com Received: from mr.google.com ([10.204.133.196]) by 10.204.133.196 with SMTP id g4mr9936551bkt.0.1330923064621 (num_hops = 1); Sun, 04 Mar 2012 20:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wI4gqkuUozdQv1vQTX5LpHASqtbUuv17v1HJcEkIk34=; b=nmCSUyeGI46BWOsuF7I88k0RFQ4BoGuR9tn5baHi4VY98tFSGL3jKgUbMEFP47rkls pJ8Rv/AqH01Cle6bAfIqrb5cBuEaJal+JXmVTV/VleAJAk85p47k1oXCsBVAxwFRTTIF kSEMXWekbmpDJ8ZUup3Ahq+0pGaOopEwFBygUMaL6SMixYAdzm8tErpp0/R82om2DNRa rx7oj8s/GqJ83M6b7Zxo6u85KjTgmSTh6bFyy44MlhczjTyRfHBPh72kjJm6jjBpb/Pq 8cFlR013HoyvIQWnJwoK2ufhGfEXcks/KGG8KPzfK27BqIO+satIn06EAHTSAY1j04ku OPoQ== MIME-Version: 1.0 Received: by 10.204.133.196 with SMTP id g4mr7910792bkt.0.1330923064496; Sun, 04 Mar 2012 20:51:04 -0800 (PST) Received: by 10.204.167.139 with HTTP; Sun, 4 Mar 2012 20:51:04 -0800 (PST) In-Reply-To: References: <4f5344cc.51e4cc0a.522a.1a15@mx.google.com> Date: Mon, 5 Mar 2012 08:21:04 +0330 Message-ID: From: h bagade To: Rozhuk.IM@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net Subject: Re: problem with vlan interfaces tagging/untagging in a simulated switch box 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, 05 Mar 2012 04:51:06 -0000 if you can not get the image, I've tried to draw text form here with commands: ###################### [system 1]------#--[eth0]---- # # |-- [hub0]------[vlan2] # [system 2]------#--[eth2]---- | # # | # # [eth1] # #################|##### | netgraph commands are: ncgtl mkpeer eth0: hub lower lower0 ngctl name eth0:lower hub0 ngctl connect eth2: hub0: lower lower2 ngct mkpeer hub0: vlan vlan2 vlan2 ngctl name hub0:vlan2 vlan2 ngct connect vlan2: eth1: downstream lower ngctl msg vlan2: addfilter '{vlan=2 hook="vlan2"}' ifconfig commands: ifconfig bridge0 create ifconfig bridge0 addm eth0 addm eth2 On 3/5/12, h bagade wrote: > I've tried netgraph nodes too! but stuck on the next step and asked > the problem on this forum and received no answer:( my netgraph > scenario is described below: > > I have designed a topology(attached) using netgraph to add vlan2 > tag to the frames coming from eth0(vlan port) and send it to > eth1(trunk port) to go out of the box. it works fine. > > Then I tried to add another interface like eth0 which named eth2(vlan > port) to be > tagged vlan2 too. After that, I bridged eth0 and eth2 using > ifconfig(as vlan ports are connected to each other on same vlan id). > When traffic comes from eth0(system1) to the destination > eth2(system2), all traffic also sent out eth1 which is not suitable! > > In the mentioned scenario, I don't want the traffic pass to the eth1. Is > there any way that eth1 recognize which mac addresses don't belong to this > box then sends the traffic out? I mean I want to send taraffic out of eth1 > when the destination is not accessible via FreeBSD box so it should be sent > out to be find out. > > On 3/4/12, rozhuk.im@gmail.com wrote: >> >> Use netgraph nodes. >> >> >>> -----Original Message----- >>> From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd- >>> net@freebsd.org] On Behalf Of h bagade >>> Sent: Sunday, March 04, 2012 3:31 PM >>> To: freebsd-net >>> Subject: problem with vlan interfaces tagging/untagging in a simulated >>> switch box >>> >>> Hi all, >>> >>> I have problems with vlan interfaces on freebsd. I want to make my >>> system like a switch with vlan ports and also a trunk port in >>> conjuction with other switches. I thought that vlan interfaces would >>> help me tagging traffic when traffic is going out the trunk port(or >>> when it receives on vlan ports). >>> The problem, I've encountered is that vlan interafaces on freebsd do >>> tagging/untagging when the traffic is sourced/destined from/to them >>> which in this case they should be assigned IP addresses. In other words >>> they won't tag the traffic passing through their parent interface which >>> I need to. >>> >>> In my case to be acting like a switch, interfaces on system won't have >>> ip addresses and I need to tag the traffic coming from for example >>> interface1 when passing through interfaceN(acting as trunk port). >>> How could I reach this? would it be possible to use vlan interfaces to >>> do so? >>> >>> I've tried many many ways to simulate the case but no success achieved! >>> I'm really interested to find the proper solution for my config. >>> >>> Any comments or hints are really apperciated. >>> _______________________________________________ >>> freebsd-net@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-net >>> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >> >> >