From owner-freebsd-net@FreeBSD.ORG Thu Jul 10 19:01:49 2003 Return-Path: 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 2091737B409 for ; Thu, 10 Jul 2003 19:01:49 -0700 (PDT) Received: from www.ambrisko.com (adsl-64-174-51-42.dsl.snfc21.pacbell.net [64.174.51.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 371FE43FCB for ; Thu, 10 Jul 2003 19:01:48 -0700 (PDT) (envelope-from ambrisko@www.ambrisko.com) Received: from www.ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.12.8p1/8.12.8) with ESMTP id h6B21aO7037868; Thu, 10 Jul 2003 19:01:36 -0700 (PDT) (envelope-from ambrisko@www.ambrisko.com) Received: (from ambrisko@localhost) by www.ambrisko.com (8.12.8p1/8.12.8/Submit) id h6B21Zl5037863; Thu, 10 Jul 2003 19:01:35 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200307110201.h6B21Zl5037863@www.ambrisko.com> In-Reply-To: <1057860615.3f0dac07e1418@www.nexusmail.uwaterloo.ca> To: kw3wong@engmail.uwaterloo.ca Date: Thu, 10 Jul 2003 19:01:35 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: Luigi Rizzo cc: freebsd-net@freebsd.org Subject: Re: Question about bridging code X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.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: Fri, 11 Jul 2003 02:01:49 -0000 kw3wong@engmail.uwaterloo.ca writes: [ Charset ISO-8859-1 unsupported, converting... ] | Hi Luigi, | | Thanks for response, the vmnet/tap stuff sounds like neat stuff. After reading | the description of tap (from the vtun site), the system seems to make a lot of | sense. However, I'm not sure how vmnet comes into play here - what purpose does | it serve, shouldn't I just be able to read from the /dev/tap0 and bridge | between tap0 and fxp0? | | I tried writing a simple program to use tap. Basically, I have the bridge setup | as such | | net.link.ether.bridge_cfg: fxp0:0,tap0:0 tap1:1 bge0:1 | | And I ran this quick test program that I wrote: How about a simpler one echo hello > /dev/vmnet0 cat /dev/vmnet0 | Unfortunately, it doesn't work, it only gets a read event when I make changes | to the tap interface via ifconfig. I guess I don't fully understand how | the /dev/tapN interface works, can you (or anybody who also know) point out | what I'm doing wrong? Thanks again! I use vmnet since it stays persistant across opens and closes. So the above would have issues with tap. For bridging you probably need (for -stable): Index: if_tap.c =================================================================== RCS file: /cvs/src/sys/net/if_tap.c,v retrieving revision 1.3.2.3 diff -c -r1.3.2.3 if_tap.c *** if_tap.c 14 Apr 2002 21:41:48 -0000 1.3.2.3 --- if_tap.c 11 Jul 2003 01:57:28 -0000 *************** *** 426,431 **** --- 426,432 ---- return (dummy); case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ + tapifinit(tp); case SIOCADDMULTI: case SIOCDELMULTI: break; or you lose stuff. I have a user-land packet translator that opens a couple of vmnet devices and then bridge those nodes to the HW I want. It works well. Initially I used tap but since every open and closed created a new iface instance the world started to go bad after a lot of stops and starts of the program. Doug A.