Skip to main content

Questions tagged [tun]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
73 views

Packets sent to tun Interface not received by Application

i have been stuck at this problem for quite some time and just can't figure out what I am doing wrong. What I am trying to achieve is to intercept packets (IP and TCP), change their header and then ...
Vollidiotischer's user avatar
1 vote
0 answers
589 views

what effects performance of a tun/tap or a virtual network interface?

I know what a tun/tap device does in linux. if I create a new tun interface with only a name and assigning an IP address to it, and leave other settings as default, like this: sudo tunctl -t tun0 sudo ...
user3840019's user avatar
0 votes
0 answers
341 views

NAT Between TUN and Ethernet Network Interfaces

There's a detailed explanation of the setup and my debugging efforts so far, but the main question is at the bottom. I have a setup like so: Machine A has two network interfaces: eth0 (192.168.159.60)...
Jordan's user avatar
  • 117
0 votes
1 answer
342 views

Is the outgoing connection from a OpenVPN client to a LAN behind an OpenVPN server forwarded by the server kernel?

I've observed a somewhat strange behavior that I can't quite understand. So I set up an OpenVPN connection as shown in the graphic below. (It's a TUN and client-to-client setup). My thoughts are ...
Koala's user avatar
  • 3
0 votes
1 answer
1k views

proper way of NATing and Routing when using TUN interface with iptables

edit: I'm a newbie in networking and discovering new things :) I created a TUN interface programmatically and able to interact with. I set it up and running by ifconfig myTun 10.10.1.1/24 up and its ...
user3840019's user avatar
0 votes
0 answers
309 views

Reply IP packets lost when using eBPF and AF_XDP --- where do they go?

I have a test case eBPF/AF_XDP test case which is supposed to take incoming ethernet packets from an interface, send them to user-space using an AF_XDP socket, filter them according to some criterion (...
Chris Ward's user avatar
2 votes
2 answers
1k views

qemu commandline can't see /dev/net/tun

i am newbie with qemu and libvirt. I hit the issue with virsh and qemu, especially with tun interface setup. Once i run qemu-system-x86_64 \ -nographic -enable-kvm \ -cpu host -m 2048 \ -...
raphaelnadal's user avatar
0 votes
0 answers
184 views

Is it possible to read less than 4 bytes from TUN device when IFF_NO_PI is not set?

I was reading the implementation of wireguard-go, and found it handles reading less than 4 bytes from the TUN device file when the no packet information flag is not set. I wonder is it possible that ...
Sirius Lee's user avatar
0 votes
1 answer
3k views

I am creating a tun interface with sudo ip tuntap add dev <interface_name> mod tun, but it's not receiving packets when I ping it?

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 ip addr show ...
Happy Jerry's user avatar
0 votes
0 answers
1k views

tun2socks configuration not working

I am trying to configure a tun2socks server that forwards all traffic to an external proxy found online. I also want to retain the ability to ssh into the server so I had to take this into ...
sololuvr6969's user avatar
0 votes
0 answers
367 views

Testing a tun tunnel between an Ubiquiti edge router and a Linux Server

I am following the first example setup for OpenVPN which involves establishing a TUN tunnel. On the server I run: openvpn --ifconfig 10.200.0.1 10.200.0.2 --dev tun The ubiquiti Edge Router is ...
M.E.'s user avatar
  • 124
0 votes
1 answer
844 views

QEMU VM with tap interface sees all packages coming from hypervisor instead of real source IP

I have set up a very simple Hypervisor using Alpine Linux and my VM sees all traffic coming from the IP of the hypervisor. Which also means if fail2ban tries to block attacks, it always blocks the ...
Christian's user avatar
  • 333
4 votes
1 answer
3k views

What does ip addr add dev tun1 local 192.168.69.0 remote 192.168.69.1 mean? [closed]

I found the following set of commands to open a tun device on linux that relays things to the internet. However, packets are not relayed back to the tun device ip tuntap add dev tun1 mode tun user `id ...
Guerlando OCs's user avatar
0 votes
0 answers
2k views

Forwarding Traffic from TUN interface to XX

My setup is the following: I'm writing a program that creates a tun interface and writes raw (Layer 3) packets to that interface. For example a ICMP ping packet (to make things easy). Now i want to ...
Juan Thomas's user avatar
1 vote
1 answer
329 views

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 ...
hamidi's user avatar
  • 21
1 vote
1 answer
5k views

Route all traffic through TUN interface

I want all my traffic go through TUN interface. So, as you can see, the traffic is routed to TUN iface on 10.0.0.1 address from every program. Then, the program attached to the TUN does something ...
thedenisnikulin's user avatar
2 votes
0 answers
173 views

Is there a tool I can use to test out multiple vpn tunnels in one machine?

I use wget -q -O https://checkmyip.com/csv to determine if I am connected to a VPN but I want to verify multiple VPN tunnels on the same machine. Is there a tool that can allow me to send a command ...
LeanMan's user avatar
  • 181
0 votes
0 answers
1k views

Attach a VM to a host TAP or TUN device

I'm working on a project whilst in lockdown in England, and I am hoping someone can offer some advice? I have a machine with 5 physical eth interfaces on Linux Mint, 20.04. All eth interfaces ...
Bon's user avatar
  • 1
3 votes
0 answers
317 views

How to migrate OpenVPN architecture TAP to TUN

I did a tunnel system with OpenVPN to let a distant client act like a private network client to access private resources. It uses a client on the private network as a gateway. DistantClient <-> ...
Doubidou's user avatar
  • 131
0 votes
1 answer
1k views

Unable to connect VPN client to OpenVPN server running Ubuntu 16.04.6

im a bit new to Linux and also rather stuck with this... any help here would be much appreciated... I am running Ubuntu 16.0.4 on my server and trying to connect a client to it but no luck. The ...
Lewis's user avatar
  • 1
0 votes
0 answers
7k views

OpenVPN: Cannot open TUN/TAP dev /dev/net/tun: Operation not permitted

I'm have some trouble with OpenVPN reccently, OpenVPN server are hosted on a VPS. It had been work for few months but last friday I reboot and update and upgrade since impossible to connect from my PC ...
Alexandre Serrano's user avatar
0 votes
0 answers
230 views

Embedding 3 bytes custom data in IPv4 header and then filter by iptables

In my modified OpenVPN server process, as an intermediate node, I'd need to embed my custom 3 bytes data in the header of every IP packet and then in the same machine (after going through tun) filter ...
frogatto's user avatar
  • 103
0 votes
1 answer
2k views

tun/tap works on incoming or outgoing packet?

When we create a tun virtual interface we use read and write to read and write packets from/into network stack. My question is when we use .read, we are actually reading outgoing packets (the packets ...
AMIR's user avatar
  • 3
0 votes
1 answer
320 views

what is difference between simple TUN and VPNs like PPTP and L2TP

In respect of VPNs and tunneling, as far as i know, TUN is a virtual interface works on network Layer 3 (IP packets), and is nothing more than a simple more likely UDP socket link in practice (I think)...
Mehrdad Dadvand's user avatar
5 votes
1 answer
3k views

socat tun device very low throughput

I was tinkering around with socat and tried to use socat for creating a TUN device for tunneling between two debian stretch servers. However, throughput seemed very low and comparing with iperf ...
1gd_1bs37coua9dd's user avatar
2 votes
0 answers
1k views

write into a tun interface and forward traffic to another computer

I have the following setup. An application on machine A creates an IP packet which is captured by the tun1 interface. I have added the route using the command : sudo route add -host 10.129.131.220 ...
Debashish's user avatar
  • 121
12 votes
2 answers
26k views

OpenVPN persist-tun option - what's the point?

According the OpenVPN 2 Cookbook: The persist-tun and persist-key options are used to ensure that the connection comes back up automatically if the underlying network is disrupted. These ...
tenjohn's user avatar
  • 223
3 votes
1 answer
6k views

Multiqueue tun/tap interface

I am trying to understand how Multiqueue tuntap interface works. Following the instructions provided at: https://www.kernel.org/doc/Documentation/networking/tuntap.txt I was able to create multiple ...
Deys Nima's user avatar
2 votes
1 answer
2k views

IPv6 on Linux tun/tap: NDP not working

I am working on an old code that used to connect different IPv6 devices over a different kind of network (a powe line netwrok, PLC, which is quite similar to 802.15.4). To do that, it created Linux ...
Woody Wu's user avatar
  • 191
2 votes
1 answer
6k views

OpenVPN TAP vs TUN in parallel

I have a few questions about our existing OpenVPN server setup and a requirement that we have to expand our access. Our current setup is as follows: 1 OpenVPN server (in TAP mode) Multiple VM ...
Adam Blalock's user avatar
0 votes
1 answer
1k views

How to set up single client TAP/TUN on the client for my OpenVPN?

My laptop OpenVPN client establishes a TAP device. My client config is TUN, though. This devices shows under ifconfig /ALL with the IP 10.8.0.6 and a subnetmask of 255.255.255.252. (!!!) This ...
bomben's user avatar
  • 115
0 votes
1 answer
2k views

Can the inet address assigned to P-t-P tun interface be used for a client inet address if the server runs out of all addresses within a subnet?

I have an OpenVPN server with an Inet address 10.8.0.1 serving the subnet 10.8.0.0/24. I have two clients connected to this server and the status log (/etc/openvpn/openvpn-status.log)reads as follows: ...
Arjun Balakrishnan's user avatar
2 votes
1 answer
2k views

Issues setting up TINC on Mac OSX 10.12.2

I have TINC setup on a few linux boxes and they are working great. linux001 (static ip vps - 10.0.0.1) macosx002 (connects to linux001 - 10.0.0.2) linux050 (connects to linux001 - 10.0.0.50) I also ...
CaffeineAddiction's user avatar
0 votes
1 answer
193 views

OpenVPN allows some users to jump to other hosts in the LAN

All users can connect to host where OpenVPN runs but some users can jump to other hosts in the LAN. For example, foo user can reach host 10.2.0.1/32 (where OpenVPN runs) and hosts at 10.0.0.0/24 but ...
facundobianco's user avatar
0 votes
1 answer
3k views

openvpn - Why do I have 2 tun interfaces on my server?

I have just configured watching this Hak5 video I found on Youtube. But what is bothering me is that why do I have two tun interfaces on my server ? Namely-: tun0 Link encap:UNSPEC HWaddr 00-...
ng.newbie's user avatar
  • 103
0 votes
1 answer
528 views

Why is my host not receiving packets sent across tun0?

I have a tun0 interface set up which allows packets to be sent as such: HOST (aaaa::1) ----> tun0 ----> SLIP ----> Router (aaaa::200:0:0:1) The router receives the packets, and can send back a ...
mbadd's user avatar
  • 101
0 votes
1 answer
2k views

How do I route traffic over the a tun0 device (IPSec VPN connection)?

I've set up an IPSec VPN tunnel between my laptop and work. The tunnel gets established, but routing does not. The relevant part of ifconfig is : eth0 Link encap:Ethernet HWaddr d4:be:d9:6f:a7:...
sbrattla's user avatar
  • 1,630
0 votes
1 answer
43 views

Endpoint to security gateway tunnel

I want to establish a connection between the client and the proxy server through a VPN tunnel in android device. I want to do this at layer 2 or 3 , where a packet can captured and encrypted. Please ...
user2044000's user avatar
5 votes
3 answers
632 views

How do VPN servers/clients avoid routing their own remote connection packets through themself?

I am trying to conceptualise how networking works under the hood for linux VPNs which use TUN interfaces. My current best guess is as follows (please correct me): Connection established to remote ...
64bit_twitchyliquid's user avatar
1 vote
0 answers
778 views

Direct all traffic between Eth0:1 interface and VPN Tun0

If answered correctly this question will show you how to link a 2nd public IP address on a machine to a VPN server tunnel on that machine, so that the remote VPN client (running a server), sees this ...
Bob Spar's user avatar
0 votes
1 answer
437 views

OpenVPN - connect server as client to itself

I have tried to setup a small openvpn network but I ran into one big problem. I have a server and a machine at home. So I created a openvpn server on my machine and a configured the client on the ...
user avatar
1 vote
1 answer
1k views

Prevent IP Spoofing on OpenVPN tun

I have a question regarding IP Spoofing and authentication. I have an OpenVPN server in TUN mode with many untrusted clients in the same VPN network, and I was wondering if one client is able to spoof ...
poli mi's user avatar
  • 13
0 votes
1 answer
2k views

/dev/net/tun exists, but OpenVPN is refussing to find it

I'm currently configuring an OpenVPN client on an arm microprocessor running debian squeeze, however I'm running into problems. As the below shows, /dev/net/tun exists: debarm:~# whoami root debarm:~...
Liam Wiltshire's user avatar
12 votes
1 answer
16k views

How to create /dev/tun device inside unprivileged LXC container?

This question is similar to No tun device in lxc guest for openvpn . The LXC has evolved and the unprivileged LXC containers were introduced recently that offer another layer of security against ...
Adam Ryczkowski's user avatar
3 votes
1 answer
7k views

What exactly happens to packets written to a TUN/TAP device?

I'm trying to send packets to an application listening on eth0 from machine's user-space as if they were coming from a remote machine. What I can't seem to find good documentation for is the exact ...
user3467349's user avatar
0 votes
0 answers
94 views

OpenVPN tunnel not able to support secure connect request

In CentOS 7 host we have installed openvpn package and did create an tunnel using OpenVPN tunneling for eth9 and tap9. Everthing work fine for unsecure connection but when we try to connect to server ...
Abhinav's user avatar
  • 225
2 votes
2 answers
1k views

Use OpenVPN tun device for specific request

I have setup an OpenVPN connection with the route-nopull configuration. So now no special routes have been added to the client's configuration and only a TUN device is created, like so: tun0 ...
Jelle De Loecker's user avatar
1 vote
1 answer
201 views

Setup openvpn as interface device only

I just setup OpenVPN client using this guide on The Geek Stuff But now (somewhat as expected) all my traffic is routed through the VPN. I actually just want to set up the interface device. Does ...
Jelle De Loecker's user avatar
0 votes
2 answers
3k views

OpenVPN Tunnel between two LANs, traffic dropped on the way?

I'd like to create a OpenVPN Tunnel between to LANs 192.168.1.0/24 and 192.168.2.0/24. However somehow packets entering the tunnel on one side don't come out of the other side ... The following ...
buergi's user avatar
  • 101
0 votes
2 answers
5k views

openvpn connection has established but cant ping the server

I have a openvz vps and setup a openvpn server, and I successfully connect to the server in my ubuntu 14.10 client. server.conf: port 1199 proto udp dev tun ca ca.crt cert server.crt key server.key ...
hich9n's user avatar
  • 101