linuxdeploy icon indicating copy to clipboard operation
linuxdeploy copied to clipboard

Can not create TUN interface?

Open embeeweezer opened this issue 12 years ago • 7 comments

I run debian wheezy on my galaxy s2 and like to run software that uses a TAP/TUN network interface. I can not get the system to create it... On the android side I checked with the 'Tun.ko installer' app and it says 'Tun module is loaded - Your kernel has TUN driver loaded natively' so that looks ok. I think on the linux side the module also needs to load?

This guy seems to do something like it with Debian Kit for Android but I still don't understand: (use ctrl+f to find the word 'tun') http://sven-ola.dyndns.org/repo/debian-kit-en.html

I would really like to use it with linuxdeploy! Hope you can help me out!

Best regards,

Mike.

embeeweezer avatar Sep 29 '13 15:09 embeeweezer

You need build and install tun kernel module for your kernel.

meefik avatar Oct 31 '13 14:10 meefik

For what it's worth, on my Nexus 5, tun is located at /dev/net/tun instead of /dev/tun. Creating a symlink

ln -s /dev/net/tun /dev/tun

got openvpn working for me. Other software probably expects to find tun at /dev/tun as well.

evs-chris avatar Feb 18 '14 22:02 evs-chris

If someone ever runs through this problem, I had the same issue while running on Cyanogen Mod 12.1 and actually OpenVPN expected tun to be in /dev/net/tun so I had to do

mkdir /dev/net
ln -s /dev/tun /dev/net/tun

Hope it helps

g-goessel avatar Nov 07 '15 22:11 g-goessel

Thanks @g-goessel , vpn works, connected and tun0 with ip. The problem is I cant ping to vpn network. It claims that the packet is filtered. Anyone knows the iptables rules to add? I´ve tried a few with no luck.

Thanks in advance!

ismaGNU avatar Nov 17 '15 10:11 ismaGNU

the problem is with tun interface, not with firewall. Something wrong. My issue is described detailed here: https://github.com/meefik/linuxdeploy/issues/1130

UralZima avatar Oct 31 '19 20:10 UralZima

ip rule add from all lookup main pref 1

UralZima avatar Nov 01 '19 07:11 UralZima

Actually, if "/dev/net/tun" has already existed, you should authorize to it. chmod 0666 /dev/net/tun Then, you should stop and start the service which needs to use TUN/TAP. https://docs.kernel.org/networking/tuntap.html

2784343633 avatar Jun 14 '23 06:06 2784343633