Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Trouble enabling a TAP interface on a debian box

Hey!

I just got a new VPS to install an openvpn/pi-hole on it, but I'm having trouble finding the TUN interface, it appears in the /dev/net/ folder, but not in "ifconfig -a" or in "ip a".\

I read that it can be activated by using "modprobe tun", but I get this error:

modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/2.6.32-042stab134.8/modules.dep.bin'

modprobe: FATAL: Module tun not found in directory /lib/modules/2.6.32-042stab134.8

Comments

  • On OpenVZ, the host node needs to load modules; you can't.

  • Thanks Letzien, I take this to mean that I won't be able to install a VPN with this particular provider?

  • Send them a support ticket and ask them to ensure tap/tun modules are enabled on the host node. If they offer it in the control panel, it's probably an oversight from the last kernel update and/or forgot to add to /etc/modules.

  • Actually, did you try to cat /dev/net/tun? It might be there.

  • I got this:

    user@vps:~# cat /dev/net/tun
    cat: /dev/net/tun: File descriptor in bad state

    The tun file is there, but I can't get the interface to show up with ip or ifconfig.

  • LetzienLetzien Member
    edited March 2019

    It looks fine to me; tun doesn't work the same as tap. Try making one.

    $ sudo openvpn --mktun --dev tun0
    Mon Mar 18 15:34:55 2019 TUN/TAP device tun0 opened
    Mon Mar 18 15:34:55 2019 Persist state set to: ON
    
  • Hmm, the tutorial I'm following says I should be able to get an IP from the interface, and I was able to follow through fine from my raspberry pi at home. Do you know where I could read up more on this? I can't find much online about this issue.

  • LetzienLetzien Member
    edited March 2019

    You're supposed to blindly open it, then the device will be made. Check the kernel tree:

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/tuntap.txt?id=HEAD

    sudo ip tuntap add mode tun dev tun0
    ip addr add 192.168.0.2/24 dev tun0
    
  • Thank you! That did the trick!

    It looks fine to me; tun doesn't work the same as tap. Try making one.

    $ sudo openvpn --mktun --dev tun0
    Mon Mar 18 15:34:55 2019 TUN/TAP device tun0 opened
    Mon Mar 18 15:34:55 2019 Persist state set to: ON

Sign In or Register to comment.