Questions tagged [tun-tap]

28 questions
0
votes
0 answers

How can I set network priority for packets sent via TAP interface?

I have a TAP interface with multiple queues and I am trying to apply a tc taprio qdisc to the interface. For this, I need to write traffic of a specific linux network priority to the TAP interface. So for example, all traffic that goes into TAP…
quasi
  • 1
  • 1
0
votes
1 answer

Cancellation points in Critical Section

I have implemented a multithreaded application using pthread. In this application there are two threads: The first polls a tap port in order to read the available data and write it to a serial port to which a radio is connected. The second vice…
0
votes
0 answers

Os permission error when trying to create a `tun` device

I'm trying to create a tun device with rust's tun_tap create, I'm following documentation and trying to create an interface with the tun_tap::Iface::new(..);, but I'm getting the error below. Error: Os { code: 1, kind: PermissionDenied, message:…
Emad Baqeri
  • 2,333
  • 2
  • 14
  • 29
0
votes
0 answers

Running my code that creates TUN interface, And simulating TCP listening port in my code. So received SYN packet responded with SYN+ACK in the code

I have simple server that reads IP packets from TUN0 interface. And in this code I am trying to Simulate behavior of TCP listening port at port 80 so call it a server. So if I get SYN requests then I respond it with SYN+ACK response. I am repeatedly…
user786
  • 3,902
  • 4
  • 40
  • 72
0
votes
1 answer

How to send a HTTP Request using a tun tap interface

I am working on a network proxy project and a newbie to this field. I want to create a tun-tap interface and send an HTTP request through this interface. Here is my approach. use tun_tap::Iface; use tun_tap::Mode; use std::process:Command; fn…
0
votes
1 answer

How to test ICMP in my stack over TAP device?

I'm writting code to implement a simple TCP/IP stack over TAP device. But when I want to test ICMP code, I find that ping $(TAP IP) won't send packets to TAP device. It always sends them to loopback. So how can I test my ICMP code? My system is…
HypoGump
  • 51
  • 1
  • 10
0
votes
1 answer

How to make a transparent proxy on macOS with Docker instead of Virtualbox?

There is a github project VRouter which make Openwrt image as an vbox on macOS and routing the traffic to the NIC of the virtual machine as a transparent proxy. I would like to know that is it possible to do these things o with docker? As fas as I…
qiwihui
  • 63
  • 1
  • 4
  • 10
0
votes
1 answer

why the leading 4bytes data missing when sending raw bytes data to a tap device?

i'm learning the tun/tap device of linux, there is a little problem i cannot figure out here is what i've done: 1: create a tap device, name is "tap1", get the file descriptor: tapfd 2: prepare an array huge enough, like: buf[2048] 3: write a…
0
votes
0 answers

iptables NAT not applied to packets from a TAP interface

The iptables MASQUERADE NAT rule is not being applied to packets that have come from a TAP interface. I have an application tied to two TAP interfaces that is used for some packet manipulation during routing. I am using iptables to apply a netfilter…
Steve
  • 11
  • 4
0
votes
0 answers

a write() to tun/tap interface returns "invalid argument"

I have successfully created and attached to a tap interface. I can also read from the interface with no problem. But trying to write to it fails reporting "invalid argument". The code follows : int TapInterface::write(char *buf, int n) { int…
ae41
  • 15
  • 5
0
votes
1 answer

Incomplete type 'struct ifmediareq' (ioctl)

I'm trying to rewrite some source code and I have the following function: tuntap_interface::if_ioctl(u_int32_t cmd, void *arg) { dprintf("tuntap: if ioctl: %d\n", (int) (cmd & 0xff)); switch (cmd) { case SIOCSIFADDR: { …
Dan Ramos
  • 1,092
  • 2
  • 19
  • 35
-1
votes
1 answer

How to tell where linux kernel is parsing MLD joins on tuntap interface?

I have been working on a program which uses a TUNTAP interface (in TUN mode) on a routing device which runs on top of the Linux kernel. It is a multicast tunneling protocol, and I am trying to send MLD joins to the kernel through my application so…
Dan
  • 21
  • 6
-1
votes
1 answer

read(2) on Tun fd returned zero

In my application, a Tun interface was created and the process keep reading the associated fd with read(2) in a select(2) loop. But, when I was debugging an issue in the application, I found that in some moments the read(2) operation on the Tun…
Woody Wu
  • 358
  • 3
  • 13
1
2