Questions tagged [tun-tap]

28 questions
6
votes
2 answers

Qemu Network Options: tap vs bridge

I just started learning how to use Qemu for a project. I was trying to run Qemu using using bridge networking and was wondering what is the difference between the network options, tap and bridge. I read the network options part in the Qemu document…
Kris
  • 61
  • 1
  • 2
5
votes
0 answers

ovs tap "internal" vs tuntap tap

I'm building an SDN testbed consists of an OpenvSwitch switch installed on Linux Ubuntu 18.04 and 5 VMs (Linux Ubuntu 16.04 server) running on VirtualBox. The OVS is managed by OpenDaylight Boron. When I use ip tuntap add mode tap tapN to create…
Ahmed Sallam
  • 51
  • 1
  • 5
3
votes
1 answer

Send raw IP packet with tun device

I'm trying to programmatically construct and send IP packet through TUN device. I've setup the TUN device and proper routes: # ip tuntap add mode tun tun0 # ip link set tun0 up # ip addr add 10.0.0.2/24 dev tun0 which results in: $ route -n Kernel…
PovilasB
  • 1,488
  • 1
  • 15
  • 25
3
votes
0 answers

Is there any maximum limit to create tun/tap interfaces on a linux machine? Also, what are the parameters that put constraints to the limit?

I have been working on the ns-3 (communication network simulator) communication simulator, where there is a provision called TapBridge mechanism to interface external data sources to the communication nodes. But, for each data source a tap device…
2
votes
1 answer

Convert `ip tuntap add` system() call to C code

I'm trying to convert a system() call I have in C that calls ip tuntap add ... to C code that doesn't rely on the system() call. Basically, it's a problem that the tunnel adapter that I use the system("ip tuntap add ...") call to bring up is left…
Nathan F.
  • 3,250
  • 3
  • 35
  • 69
2
votes
1 answer

How to install tun on Ubuntu 16.04

I try to install tun on Ubuntu 16.04, it generates the tun.ko, but it still doesn't work. 1 Uname -a Linux host-name 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux 2 apt-get install…
bsf
  • 47
  • 1
  • 1
  • 3
2
votes
1 answer

how to use SIOCIFDESTROY in FreeBSD?

My app creates a tap interface, and everything works well. But on FreeBSD, when it exits, the tap interface remains. To delete it, I have to manually run this command: sudo ifconfig tap0 destroy But I'd like to do this programmatically within my…
Stéphane
  • 19,459
  • 24
  • 95
  • 136
1
vote
1 answer

Using tun_tap_mac crate on MacOS

I'm trying to use the tun_tap_mac crate on MacOS and I'm having trouble with getting started. Here's my code: fn main() -> io::Result<()> { let nic = tun_tap_mac::Iface::new("tun0", tun_tap_mac::Mode::Tun) .expect("Failed to create TUN…
Kiwi breeder
  • 459
  • 4
  • 11
1
vote
1 answer

Failed to load XDP program inside a QEMU VM with custom (bridged) tap device

I'm recently trying to load XDP program inside a QEMU VM (with virtio-net-pci as NIC driver, and tap device as the backend). It seems that by doing so my NIC is required to features vCPU*2 of queues, which can be done by declaring it at QEMU startup…
Feng. Ma
  • 121
  • 8
1
vote
1 answer

wrong sequence number using tun/tap interface

I'm trying to read TCP packets into a struct using tun/tap, So IFF_TUN flag is set to use tun device (no ethernet headers). I have structs like these (I don't care about endian issues): Tcp Header: struct tcphdr { uint16_t sport; uint16_t…
AMIR
  • 81
  • 1
  • 6
1
vote
0 answers

Exchange messages between two TUN/TAP running devices

(I'm new to network programming)I want to use n2n to create a network of various machines connected to the internet an I want them to exchange data using some protocol like TCP/UDP. I have started an issue on their github but it seems they have…
1
vote
2 answers

Setup a GRE tunnel with dedicated IP in GCP VPS instance, CentOS7

I had create a new VPS instance in GCP successfully. Logged in via ssh and take root access. My commands to setting up a tun1 interface was successfull done: ip tunnel del tun1 ip tunnel add tun1 mode gre remote xxx.xxx.xxx.xx local xx.xxx.xxx.xxx…
Legion
  • 90
  • 11
1
vote
1 answer

How to improve throughput of TUN interface when using Erlang TUNCTL

I'm using TUNCTL with {active, true} to get UDP packets from a TUN interface. The process gets the packets and sends them to a different process that does work and sends them to yet another process that pushes them out a different interface using…
Roman Rabinovich
  • 868
  • 6
  • 13
1
vote
0 answers

Using TAP to sniff or modify incoming eth packets

I've tried https://github.com/TOGoS/TUN2UDP This allows me to do: Application --> TAP Read from TAP --> Write to UDP (under my control) Read from UDP --> Write to TAP (under my control) TAP --> Application What I want to do is: Application -->…
GroovyDotCom
  • 1,304
  • 2
  • 15
  • 29
1
vote
1 answer

Create VPN over TCP connection

I need to create a virtual IP network over TCP connection. The hosting system is Linux, with the TUN/TAP kernel driver, it's quite easy to receive & re-inject IP packets of the virtual network. The difficult part is to transmit the received IP…
user416983
  • 974
  • 3
  • 18
  • 28
1
2