Hot answers tagged

9

Regarding TUN and TAP devices: it is not enough to make the check above. The reason is that there may be cases when we create a TUN device and (by error) call it tap10; or create a TAP device and name it tun10. So, how can I know if it is a tun device or a tap device, since both of course will have "tun_flags" entries? The answer is to run ethtool -i ...


8

I don't think there's an easy way to distinguish them. Poking around in /sys/class/net I found the following distinctions: Physical devices have a /sys/class/net/eth0/device symlink Bridges have a /sys/class/net/br0/bridge directory TUN and TAP devices have a /sys/class/net/tap0/tun_flags file Bridges and loopback interfaces have 00:00:00:00:00:00 in ...


5

I think you want to create a TUN/TAP interface. Both connect a userspace program to the network. A TUN interface works at the IP level; a TAP interface works at the Ethernet level. If you're interested this tutorial might be helpful in getting you started with the TUN/TAP interface. It's titled: Tun/Tap interface tutorial. If that's not the answer you ...


2

qemu is going to try to run some default scripts that will fail if you are not root. Here is a working command-line option for when you have appropriate access to the appropriate tap device: qemu-system-x86_64 ... \ -net nic,model=virtio -net tap,ifname=tap0,script=no,downscript=no The script=no,downscript=no is important to avoid that failure. You ...


2

Indeed, usbnet seems the most likely culprit. /* rx and tx sides can use different message sizes; * bind() should set rx_urb_size in that case. */ dev->hard_mtu = net->mtu + net->hard_header_len; net->netdev_ops = &usbnet_netdev_ops; net->watchdog_timeo = TX_TIMEOUT_JIFFIES; net->ethtool_ops = ...


2

An answer to this question suggested looking in /sys/, which turns out to help. For example: cat /sys/class/net/example.tap/owner reveals the uid of the owning user, or -1 if the interface isn't owned by a user. Similarly with group substituted for owner to get group ownership. I'm not sure if there's a "cleaner" method that doesn't involve delving ...


1

In your OpenVPN config files you are using tun interfaces, which operate at layer 3. That's fine, and probably what you want, but won't work with (ethernet) bridging because that requires layer 2 support. You can solve your problem in two ways. Either: use iptables to route traffic from your tun interface to the host of your choice, or use tap interfaces ...


1

The essential difference between TUN and TAP is the OSI layer at which they function (That does not include the programming required for each type of device): TAP (OSI Layer 2) - Name TAP is from to TAP into where you make a physical connection to the material (not just ethernet cables, you could TAP into a barrel of beer for example) TAP functions as a ...


1

In fact you were right about the parameter, but not the value. SingleTapTimeout is waiting for an integer (in ms). "30" works great for me.


1

Here is further guesswork. Hope this is helpful, but it may as well be embarassingly wrong. tap0 has two ends, the kernel network stack end and the program interface. It seems to me if you supply 'nicserver' with tap0, it won't attach to it the way it is intended with tap devices, using the program interface. Instead, nicserver will simply write to it ...


1

OK, I can't get the packet imported into Wireshark (there must be some headers extra or missing, not bothering to figure that out) but, this is IPv6. From your first frame, you see ff 02 00 00 00 00 00 00 00 00 00 00 00 00 00 16. That's the IPv6 address ff02::16, used for MLDv2. Edit: from your first frame, here is the IPv6 part in a format Wireshark can ...


1

If by running you mean "up", the command is: ip link set dev tun0 up


1

ifconfig tap0 should show you which process is connected to the interface.


1

This got me wondering and I had a look at the Linux kernel source (I'm assuming your question is about Linux). It appears the answer's more difficult than you'd expect. This TUN/TAP API tutorial page offers some insight. Basically, your program allocates a new TUN/TAP device by opening /dev/net/tun and sending it the TUNSETIFF ioctl. If all goes well, an ...



Only top voted, non community-wiki answers of a minimum length are eligible