TUN is a virtual network layer device which operates in OSI layer 3.
Questions tagged [tun]
149 questions
0
votes
0 answers
After using the tun mode of Clash in Linux, the "docker pull" command encountered an exception
After using the tun mode of Clash in Linux, the "docker pull" command reported the following error:
Error response from daemon: Get "https://registry-1.docker.io/v2/": EOF
But use the "curl https://registry-1.docker.io/v2/" command, get the…

qian_piao
- 1
- 1
0
votes
0 answers
How to run vtun in Ubuntu
I live in China, and I want to run a vpn through vtun,When I compile, I get the following error
/home/HouXinLin/projects/vpn/vtun-3.0.3/main.c:142: undefined reference to `clear_nat_hack_flags'
My version
GCC: gcc version 12.2.0 (GCC)
OpenSSL…

xinlin hou
- 17
- 3
0
votes
0 answers
packets not routed back to tun
I have created a tun interface in c using opening /dev/net/tun and ioctl, named it tun1.
and I make it up by:
ifconfig tun1 10.10.1.1/24 up
when I send a valid udp packet as below (actually a valid char* packet):
src addr: 10.10.1.2
dst addr:…

user3840019
- 155
- 1
- 10
0
votes
1 answer
How do I start a season on existing adapter?
I want to create a tunnel between my computer (which is connected to the router via ethernet and runs on windows) and another computer in the same subnet.
I chose WINTUN.dll for this purpose because it is much faster and more efficient than…

Noam Abargel
- 11
- 1
0
votes
0 answers
Operation not permitted for TUNSETIFF
i am trying to open a TUN device and using ioctl with operation code TUNSETIFF and getting operation not permitted error.
environment
PRETTY_NAME="Ubuntu 22.04.1 LTS"
$ docker --version
Docker version 20.10.17, build 100c701
Python 3.10.6
using…

vk-code
- 950
- 12
- 22
0
votes
0 answers
How to set the IP address and Peer IP Address of a TUN interface in C
I am a student working on a moon rover for CMU and need to work with a TUN interface communication between two devices on the rover. I can create a TUN interface, but am unable to assign its IP addresses in C and I'd prefer not to use the ip…

Henry Howland
- 31
- 4
0
votes
0 answers
Can not read packets from a tun interface
My plan is to read from one tun interface and write to another.
Here are my command when I set up the interface:
sudo ip tuntap add dev router0 mod tun
sudo ip addr add 10.0.0.138/24 dev router0
sudo ip link set dev router0 up
Here is the output of…

Happy Jerry
- 164
- 1
- 8
0
votes
1 answer
How to detect if a tun/tap device already exists
I want to create a tun device with the code, so before creating it I want to check if the tun device already exists
Right now I'm doing this by determining if the file already exists, but this method is not graceful
Is there a better way
char…

shenw
- 91
- 7
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
1 answer
Does ssh server require or use tuntap interface when tunneling?
I'm creating app to tunnel ipv4 packet using tuntap on client side and no tuntap on server side

Dennis Earlyman
- 69
- 1
- 6
0
votes
3 answers
TUN interface created from C not showing up in ifconfig output
I have written the following function that is supposed to create a TUN interface named "my_tun" on Linux:
int tun_open()
{
int fd;
if ((fd = open("/dev/net/tun", O_RDWR)) == -1) {
return -1;
}
struct ifreq ifr;
strncpy(ifr.ifr_name,…

Peter
- 2,919
- 1
- 16
- 35
0
votes
1 answer
simple incrementing of TCP sequence number and assigning it to sending tcp header acknowledgement number in C
I am simulating TCP and now I am stuck to acknowledgement number handling.
tcph->seq is received sequence number and I am assigning it to tcp->ack_seq which is acknowledgement number like
tcp->ack_seq=htons(ntohs(tcph->seq)+1);
But given the…

user786
- 3,902
- 4
- 40
- 72
0
votes
1 answer
Opening TUN interface throws either io.UnsupportedOperation or FileNotFoundError
Not really familiar with how tun interfaces work. I am not sure wether I am supposed to actually do something on my local machine (i.e. create a tun interface, install a driver or something) to get it to work or its taken care of automatically.…

12435432nm
- 121
- 4
- 19
0
votes
1 answer
Can I ping with Tun/Tap interface
I am learning routing with tuntap interfaces... and I had created a tun0 interface and configured Ip address with ifconfig command on different subnet and adding the gateway with ip route command and I have also used masquerading rule ...
my doubt…

Jarvis__-_-__
- 287
- 1
- 13
0
votes
0 answers
Name resolution for dummy interfaces
I've a virtual NIC of type NAT on my Ubuntu 20.04 virtual machine which connects it to the internet via host. For some processing, I need to route all incoming and outgoing packets via a program I've to write. For example, assume that I've to drop…

hamidi
- 1,611
- 1
- 15
- 28