From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Sat, 08 May 2010 03:54:26 +1000." <20100507175426.GA24219@diamond.realm.of.chaos> References: <20100507175426.GA24219@diamond.realm.of.chaos> From: Bakul Shah Date: Fri, 7 May 2010 11:57:02 -0700 Message-Id: <20100507185703.2EDDB5B3E@mail.bitblocks.com> Subject: Re: [9fans] tun/tap support for 9vx Topicbox-Message-UUID: 1e12e344-ead6-11e9-9d60-3106f5b1d025 On Sat, 08 May 2010 03:54:26 +1000 Tully Gray wrote: > > I have modified Erik Quanstrom's raw socket ethernet driver > for 9vx so that it uses the Linux kernel's "tap" device. Neat! > < if((fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) < 0) > --- > > if((fd = open("/dev/net/tun", O_RDWR)) < 0){ On *BSD tun is for IP frames, tap is for ethernet frames so there you'd use /dev/tap. You may wish to see how Qemu handles tap differences & multiple tap interfaces on various platforms. On Fri, 07 May 2010 19:14:58 BST "Devon H. O'Dell" wrot e: > > Yes. The tap(4) interface allows you to clone an existing ethernet > device on the system, and it's what most virtualization platforms use. Sorry for nitpicking! "tap" appears as a completely separate virtual ethernet interface to the host. The "other end" of tap is a device, to be open()ed by a program. One can bridge the host side interface to existing physical ethernet interfaces but you don't have to.