TUN is a virtual network layer device which operates in OSI layer 3.
Questions tagged [tun]
149 questions
1
vote
1 answer
if command "cat /dev/net/tun" result $string then
I'm creating a script which check if a VPS do have TUN driver enabled.
The check command is :
cat /dev/net/tun
if it return:
cat: /dev/net/tun: File descriptor in bad state
the module is enabled. otherwise return ERROR.
Here is my…

Rck
- 33
- 5
1
vote
1 answer
how to test user space tcp/ip stack?
I am working on a user space tcp stack (mostly just for fun) and I am having some trouble testing it against the unix tcp stack. Currently the only form of testing is done via unit tests. However, I want to test my tcp stack against a real kernel…

nomnombunty
- 863
- 1
- 6
- 8
1
vote
1 answer
How does kernel assign ip address and nic to sockets
When you write something like:
s=socket(AF_INET,SOCK_STREAM)
s.connect((siteIp,80))
s.send(...
How does the linux kernel know from which nic it is supposed to send the packets when no information about binding the socket is provided.
How…

sia
- 133
- 1
- 7
1
vote
2 answers
Android 4 OpenVPN App tun_builder_error (topology net30)
I've running an OpenVPN server on my server and I want to connect several devices (smartphone, notebooks, desktop computers, tablets...). I have no problem connecting notebooks with Linux or Mac OS X or my Windows 8 tablet. So that work's pretty…

moritzrupp
- 833
- 2
- 9
- 11
1
vote
1 answer
Placing a TAP-Windows device in TAP mode
I am using TAP-Windows (from the OpenVPN project) to create an interface as described here and here. I am basing my code of the example provided in the first article:
const string UsermodeDeviceSpace = "\\\\.\\Global\\";
string devGuid =…

Johan_B
- 13
- 6
1
vote
2 answers
Using TunTap with linux kernel 2.6
The TunTap documentation on the vtun site points out that the driver is only supported till Linux kernel 2.4. Is there any way to get it to run on 2.6 and 3.2 versions of Linux?
A cat on the device shows:
# cat /dev/net/tun
cat: File descriptor in…

FirstName LastName
- 1,891
- 5
- 23
- 37
1
vote
1 answer
Can you write multiple IP packets in one write to the linux tun device?
I have seen (by actually reading a tun device) that the tun driver on linux can return multiple IP packets in a single read. Is the reverse true - can you write multiple IP packets in a single write to the tun device?

Thiagarajan Hariharan
- 426
- 1
- 4
- 15
1
vote
1 answer
Filtering ethernet packets (ICMP, Bonjour) on a TAP interface on OSX
I'm writing a little tunneling app with layer 2 interfaces (TAP) as endpoints. In the course of testing this on OSX, I noticed I was getting all sorts of traffic I didn't expect on the tunnel, both when the tunnel was running on a single OSX…

nflacco
- 4,972
- 8
- 45
- 78
1
vote
0 answers
Tap Adapter on Windows 7
I'm trying to create tunnel program using python on windows. These are the steps um following:
1 - I downloaded tun/tap device
2 - Using WMI to be able to change the ip address elements
I'm facing a problem now. Tun\tap shows "IPEnabled = False"…

mahdy
- 21
- 5
1
vote
0 answers
want to change properties of an interface using win32, wmi module
I am using wmi module
x = wmi.WMI().Win32_NetworkAdapterConfiguration(index=9)
// this index for my tap drive
and change properties inside the interface , it doesn't change in the interface out there
nic = x[0]
nic.properties['NetEnabled'] = True…

mahdy
- 21
- 5
1
vote
3 answers
broadcast packets sent from tap interface not received
I am making a program similar to simpletun from here.
an application sends out UDP broadcasts to the tap interface.
program listening on the tap interface (similar to simpletun)receives the packet and echoes it again as broadcast.
I am able to see…

hiteshradia
- 357
- 2
- 9
1
vote
0 answers
is there a way to know whether tun/tap interface is opened?
I am making an application using tun interface tun0. I have been successfully able to send and receive packets through the interface. Is there any way to know when the tun interface is opened as in ifconfig tun0 up?
I want do some part of my…

hiteshradia
- 357
- 2
- 9
0
votes
1 answer
Why packets seem not relayed to target applications using TUN interface?
I am developing a VPN client on MacOS. My program creates a UTUN interface and an associated rule in the route table. Its purpose is reading packets sent to 44.10.0.0/16, doing stuff with them, then forge and reply packets to the sender…

Olshaften
- 11
- 4
0
votes
0 answers
How to specify routing tables on Android devices via tun
Device
Rooted Android 10
I compiled the Zerotier-One CLI myself via NDK and was able to run it on Android and access ZT's virtual network with the egress NIC specified (e.g. ping -I ztyvvzal2p 10.0.1.100)
Now, I want to be able to access the IP…

forDream
- 386
- 1
- 6
- 17
0
votes
0 answers
Why virtual machines on the same subnet cannot communicate with each other unless through the gateway?
I'm using AWS Firecracker to create two VMs (both have Ubuntu 22.04 OS) on a container that has Ubuntu 22.04 OS. I create a bridge br0 and assign IP address of 192.168.0.7 to it as the gateway. Then I create tun/tap virtual network interfaces for…

Mithridates the Great
- 473
- 1
- 4
- 14