Question about bridging code
Doug Ambrisko
ambrisko at ambrisko.com
Thu Jul 10 19:01:49 PDT 2003
kw3wong at 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.
More information about the freebsd-net
mailing list