TUN is a virtual network layer device which operates in OSI layer 3.
Questions tagged [tun]
149 questions
0
votes
0 answers
how to attach to a TAP interface from two different processes
I have a tap interface created like this:
ip tuntap add dev tap0 mode tap user myusername
ip link set tap0 up
I then attach to tap0 using python and another program written in C++
Python:
def tapAlloc(tapname, mode):
tap =…

brainydexter
- 19,826
- 28
- 77
- 115
0
votes
1 answer
Converting raw packet data received from a TUN interface
I'm trying to intercept packets going through a TUN interface.
I want to convert the raw packet information to readable information so i can use it later.
I'm using the following code:
int main(){
char tun_name[IFNAMSIZ];
char data[1500];
…

HaTiMuX
- 621
- 2
- 10
- 22
0
votes
1 answer
Android VpnService: Reading from Tun device hangs
My app is using VpnService for traffic interception.
What it does:
1.Reads from Tun device in a loop:
while (started && tunDevice.valid()) {
final byte[] bytes = tunDevice.read();
IpPacket packet = PacketFactory.createPacket(bytes);
if…

user578468
- 9
- 3
0
votes
1 answer
tun device: message is not received by server process
I set up two tun devices. The data that is written to each tun device is forwarded over a UDP socket to the other tun device using a simple loop:
// the tuntap device is created using these flags
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
[...]
fd_set…

manuels
- 1,511
- 3
- 14
- 26
0
votes
1 answer
10G Linux VPN performance
I have a Linux box wich has several 10 Gbe interfaces. What I want is to make a crypto-tunnel that has an ability to process 10 Gbit/s traffic as well as 10 Gbit/s router/firewall. There are some ways to achieve this but as I see it all the ways are…

Ilya Matveychikov
- 3,936
- 2
- 27
- 42
0
votes
1 answer
Linux: How to simulate incoming packets on an interface?
How can I simulate some incoming traffic on a specific software interface? The reason for this need is that we have a couple of software interfaces between Ether level and IP level, which will parse our own L2.5 headers along the network stack, i.e.…

wei
- 6,629
- 7
- 40
- 52
0
votes
1 answer
TUN/TAP write back to tunnel
My app is using a TUN say tun0. In the design, my app will receive an UDP which includes an full IP layer, then I will take the IP layer out and then use 'file write' to put them into my own tun0 device, supposedly in design, I should can read the…

Yang
- 1,285
- 1
- 10
- 14
-1
votes
1 answer
CoreOS - expose host ports to VPN
I run docker Openvpn container in CoreOS:
docker run --cap-add NET_ADMIN --device /dev/net/tun ...
Container connects to VPN as client and other VPN clients can ping the container. It runs normal openvpn process inside it with dev tun option in…

Croll
- 3,631
- 6
- 30
- 63
-1
votes
1 answer
Not able to forward traffic from `tun` interface to `lo`
Originally asked here: https://networkengineering.stackexchange.com/questions/56278/not-able-to-forward-traffic-from-tun-interface-to-lo
I am writing a small VPN server, in which for a certain ip address, I am passing the traffic through an http…

Akshay Deo
- 528
- 1
- 6
- 22
-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
votes
1 answer
How can I modify, compile and install tun.ko?
I've never compiled a single kernel module. I would like to understand how to change the source of a kernel module, compile and install it on Debian SO.
Can someone illustrate the steps or tell me a tutorial about it?
Thank you and everyone.

Phocs
- 2,430
- 5
- 18
- 35
-2
votes
3 answers
SQL query optimize for update
This query take long time to update I would love to optimize this query,
your help will be appreciated.
DECLARE @text1 NVARCHAR(50) = N'test1'
DECLARE @text2 NVARCHAR(50) = N'test2'
DECLARE @text3 NVARCHAR(50) = N'test3'
DECLARE @text4 NVARCHAR(50)…

John
- 1
-2
votes
1 answer
How to enable TUN on Debian VPS?
I have a VPS with Debian7
Need to setup OpenVPN on it
So I had installed and configured OpenVPN but now um stuck with TUN error.
lsmod | grep tun - returns empty, so I need to load tun module to kernel.
modprobe tun - returns this
modprobe: ERROR:…

Supply
- 51
- 2
- 13
-3
votes
1 answer
IP needed on Linux bridge between 2 TAP interfaces?
I am trying to setup openvpn on a server so that I have 2 different tap interfaces (tap0 and tap1) and then a bridge connecting those interfaces. The idea is that a client on tap0 will be able to talk to a client on tap1 and vice-versa.
There is no…

Alexandre Thenorio
- 2,288
- 3
- 31
- 50