qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] make qemu use tap0 instead of tun0


From: Herbert Poetzl
Subject: Re: [Qemu-devel] make qemu use tap0 instead of tun0
Date: Thu, 7 Jul 2005 03:55:30 +0200
User-agent: Mutt/1.5.6i

On Wed, Jul 06, 2005 at 07:08:42PM -0400, Jim C. Brown wrote:
> When in tuntap mode, qemu creates a tap device with names like tun0, tun1,
> etc. which seems to confuse some users (the smart ones who ask why qemu uses
> IP frames instead of ethernet frames ... or something along those lines).
> Theses should be named tap0, tap1, etc. This patch fixes qemu.
> 
> I don't think this would break anything (correct qemu-ifup scripts shouldn't
> care about the name of the tuntap device that qemu uses).
> 
> -- 
> Infinite complexity begets infinite beauty.
> Infinite precision begets infinite perfection.

> --- vl.c.1    Wed Jul  6 19:03:45 2005
> +++ vl.c      Wed Jul  6 19:04:23 2005
> @@ -1629,7 +1629,7 @@
>      }
>      memset(&ifr, 0, sizeof(ifr));
>      ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
> -    pstrcpy(ifr.ifr_name, IFNAMSIZ, "tun%d");
> +    pstrcpy(ifr.ifr_name, IFNAMSIZ, "tap%d");
>      ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
>      if (ret != 0) {
>          fprintf(stderr, "warning: could not configure /dev/net/tun: no 
> virtual network emulation\n");

1.1 What is the TUN ?
 The TUN is Virtual Point-to-Point network device.
 TUN driver was designed as low level kernel support for
 IP tunneling. It provides to userland application
 two interfaces:
   - /dev/tunX - character device;
   - tunX - virtual Point-to-Point interface.

 Userland application can write IP frame to /dev/tunX
 and kernel will receive this frame from tunX interface.
 In the same time every frame that kernel writes to tunX
 interface can be read by userland application from /dev/tunX
 device.

1.2 What is the TAP ?
 The TAP is a Virtual Ethernet network device.
 TAP driver was designed as low level kernel support for
 Ethernet tunneling. It provides to userland application
 two interfaces:
   - /dev/tapX - character device;
   - tapX - virtual Ethernet interface.

 Userland application can write Ethernet frame to /dev/tapX
 and kernel will receive this frame from tapX interface.
 In the same time every frame that kernel writes to tapX
 interface can be read by userland application from /dev/tapX
 device.

(from http://vtun.sourceforge.net/tun/faq.html)

best,
Herbert

> _______________________________________________
> Qemu-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/qemu-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]