Problems in TUN/TAP

KP quntmec at hotmail.com
Tue Dec 11 20:52:24 UTC 2012


Hi,

The problem is about the configuration of TUN/TAP. In my project, I have finished my script and successfully create tap0 and tap1. However, when I run my project in bochs(a emulator), it prompt a message "*** buffer overflow detected ***: bochs terminated" , which should be "tuntap network driver: opened /dev/net/tun:tap0 device" while the status of TUN/TAP is normal.

I tried to find out what happened, but failed. Detail as blow:

1)I tried ”cat /dev/net/tun“ and its feedback is ”cat: /dev/net/tun: File descriptor in bad state“

2)I tried "lsmod | grep tun". No information output.

3)I tried "modprobe tun". And then tried "lsmod | grep tun" again. The result is the same : No information output.

4)I check tap0, tap1 by the command of ifconfig. The information is blow(tap0 and tap1 is not RUNNING):

=============================================================================
lo        Link encap:本地环回  
          inet 地址:127.0.0.1  掩码:255.0.0.0
          inet6 地址: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  跃点数:1
          接收数据包:1496 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:1496 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:0
          接收字节:171417 (171.4 KB)  发送字节:171417 (171.4 KB)

tap0      Link encap:以太网  硬件地址 mac1
          inet 地址:ip1    掩码:255.255.255.0
          UP BROADCAST PROMISC MULTICAST  MTU:1500  跃点数:1
          接收数据包:0 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:0 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:500
          接收字节:0 (0.0 B)  发送字节:0 (0.0 B)

tap1      Link encap:以太网  硬件地址 mac2
          inet 地址:ip2   掩码:255.255.255.0
          UP BROADCAST PROMISC MULTICAST  MTU:1500  跃点数:1
          接收数据包:0 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:0 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:500
          接收字节:0 (0.0 B)  发送字节:0 (0.0 B)
===============================================================================

Since the system can perform on another machine normally, the code of the project is ok. I think that maybe the TUN/TAP is not installed/configured correctly. Isn't it? 

Furthermore, some information of my project is blow:
1) OS : ubuntu12.04(newly install ubuntu12.04, not upgrade from a lower version)
2) have installed brctl and tunctl(sudo apt-get install uml-utilities bridge-util)
3) the version of boche is 2.5.1(--enable-pci --enable-ne2000 --enable-pnic)
4) the configuration of tuntap in the script of boche is :

   ne2k: enabled=1, ioaddr=0x300, irq=11, mac=11:22:33:44:55:66, ethmod=tuntap, ethdev=/dev/net/tun:tap0
   pci: enabled=1, chipset=i440fx
   i440fxsupport: enabled=1, slot1=ne2k 

Finally, is all my configuration above correct? If yes, does that means some bugs within TUN/TAP?
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-bugsquad/attachments/20121212/d6f90514/attachment.html>


More information about the Ubuntu-bugsquad mailing list