Missing TUN/TAP drivers?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Missing TUN/TAP drivers?

Postby Cocohurtz » Tue Oct 31, 2017 3:15 pm

Running Mint Mate Sonya (18.2) x64 on an Acer Aspire One D257-13448. New install - only additional software installed is a few games, no software uninstalled.

My router supports running an OpenVPN server, which I use to connect to a VM running at home (that I RDP into to give me some extra juice on this underpowered netbook). The router gives me a pre-made config file that I know works because the exact same file used in the exact same way works on Puppy Linux 3.14.55 (Slacko) with the openvpn package installed.

Searching around the web, one of the issues raised was that the TUN/TAP drivers were not properly initialized. It brought me to using the command "find /lib/modules/ -iname 'tun.ko.gz' " to seek if the driver was present - the command returned no file path. I then proceeded to look into where another link told me the driver might be (/lib/modules/4.18-generic/drivers/net I believe?) and I could not find it either.

The specific error given by OpenVPN in the process is "write to TUN/TAP : Input/output error (code=5)"

Any help?

Thanks!

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Tue Oct 31, 2017 5:43 pm

Not much on the internet regarding your issue, but I did find something for RedHat here.
Error: write to TUN/TAP : Input/output error (code=5)

OpenVPN may display the error message "write to TUN/TAP : Input/output error (code=5)" if it cannot send network packets through the VPN's network interface. This is usually due to the network interface not being ready yet, and hence it's not uncommon for several of the errors to appear while the network interface is still being setup.

However if these error messages do not stop, and you are unable to access anything on the VPN network, it's likely the network interface hasn't been assigned an IP address. This is common for TAP based connections where the IP address is assigned using a DHCP server. In this instance you should enable Viscosity's DHCP support like so:

Open Viscosity's Preferences window
Select your connection and click the Edit button
Tick the "Enable DHCP" option
Click the Save button
Try reconnecting

The DHCP option should only be enabled if the IP address should be assigned by a DHCP server. Enabled the DHCP option when it's not necessary can result in the VPN network interface having multiple IP addresses assigned which can cause routing problems.

So instead of Viscosity you could try using Network manager and set ip4 to dhcp if your router supports it.

Also I'm using tun0 and have no tun.ko.gz on my system. That's about all I came up with.
Image

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Wed Nov 01, 2017 12:06 pm

All of my existing connections are already DHCP-enabled, and network manager does not show a TUN/TAP connection (only the ethernet port and the 2 wifi configs I use - home and college). Some extra searching brought up ifconfig - ifconfig also only shows three devices (Ethernet @ enpls0, what I assume is the wireless even though it states it's ethernet @ wlp2s0, and local loopback @ lo).

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Wed Nov 01, 2017 12:26 pm

Without trying to connect the VPN, can you ping your router?

EDIT: also for wireless you can use iwconfig for more info, and wlp2s0 is your wireless.
Image

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Wed Nov 01, 2017 1:32 pm

Thanks for the tip about iwconfig!

Yes, I can successfully ping my router without VPN, from the network I would connect to the VPN from, using the same address that's in my openvpn config.

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Wed Nov 01, 2017 2:14 pm

I would suggest running Puppy Linux, open Network Manager Connection Settings, and record all settings for the VPN (don't forget the advanced button), could be some simple config issue like port, encryption, compression, etc.

Also you can run it from the command line which would give lots of information. sudo openvpn client.conf substituting client.conf with the file supplied by your router, and posting the output here, with personal data removed of course.
Image

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Thu Nov 02, 2017 8:31 am

Couldn't find the network manager in Slacko, but I have a hunch it's not going to be compression or port since on Mint, the tap interface never even comes up in ifconfig OR the network manager. Meaning that unless I change the (currently found to be working on Slacko) config file, I couldn't even change the settings of the tap connection if I wanted to.

Pastebin containing the OpenVPN logs: https://pastebin.com/8ZFUszsB

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Thu Nov 02, 2017 4:48 pm

From your pastebin
Wed Nov 1 15:10:50 2017 us=176503 /sbin/ip route add 192.168.1.1/24 via 192.168.1.1
RTNETLINK answers: Invalid argument
Wed Nov 1 15:10:50 2017 us=186877 ERROR: Linux route add command failed: external program exited with error status: 2

I don't think you can add a route to an already existing route, see here and here.
Image

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Fri Nov 03, 2017 1:14 pm

Using the command "ip config" found in your second link, I looked at the routes made before and after launching OpenVPN. In neither state did that route pop up. Or am I misunderstanding what you are saying?

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Fri Nov 03, 2017 2:16 pm

Unless I'm mis-understanding, the router you want to connect to is in your home and you're trying to connect remotely. Then the Gateway in Network Manager - VPN has to point to that address, which won't be 192.168.xx.xx, it'll be what ever your ISP has assigned it.
Image

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Tue Nov 07, 2017 9:13 am

That is correct - though in the config, the gateway points to an address to a DDNS service that keeps my home IP updated. (remote mything.netgear.com *portgoeshere* - obviously a reference and not the actual address, but it's how the command goes).

Though the way I understand it - isn't the gateway supposed to be telling "this is the address of the router on the network you're connected" AFTER connection? Because that's how it behaves under Puppy.

(Also even if that were true, I can't do unicorns about it, because as I said, the VPN tun/tap interface never even comes up in the network manager or ifconfig)

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Tue Nov 07, 2017 11:23 am

Cocohurtz wrote:That is correct - though in the config, the gateway points to an address to a DDNS service that keeps my home IP updated. (remote mything.netgear.com *portgoeshere* - obviously a reference and not the actual address, but it's how the command goes).
Ah, another cog in the wheel, I guess that looks OK but I've never used a service like that.

Cocohurtz wrote:Though the way I understand it - isn't the gateway supposed to be telling "this is the address of the router on the network you're connected" AFTER connection? Because that's how it behaves under Puppy.
I think you will find with a VPN there are two gateways, the one from your normal connections, in Network Settings - IPv4 Settings- Addresses Gateway (or IPv6 if using that) that points to the local router and a separate VPN Gateway mentioned above in the VPN settings.

Cocohurtz wrote:(Also even if that were true, I can't do unicorns about it, because as I said, the VPN tun/tap interface never even comes up in the network manager or ifconfig)
My understanding, which should in no way be considered Gospel, is that the negotiation has to be done over the normal network between you and the VPN server, then the Tun0 (or whatever) is created as a new (virtual?) interface. So if you can't connect to, or the negotiations fail with the VPN server Tun0 will never get created.

Is there a way to get the actual ip of your home router just to test? This might help trouble shoot the issue.
Image

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Wed Nov 08, 2017 1:13 pm

greerd wrote:Ah, another cog in the wheel, I guess that looks OK but I've never used a service like that.

Understandable - I use it because it's free, and because my ISP has dynamic IP assignment on a lease. It's functional - as I said, it resolves to my latest home IP.

greerd wrote:I think you will find with a VPN there are two gateways, the one from your normal connections, in Network Settings - IPv4 Settings- Addresses Gateway (or IPv6 if using that) that points to the local router and a separate VPN Gateway mentioned above in the VPN settings.

In this case, my router IS my gateway. I'm not using a third-party VPN service. The only two parties in this VPN connection are my router (which is running the VPN server and connection) and this laptop connecting from a private WiFi connection.

greerd wrote:My understanding, which should in no way be considered Gospel, is that the negotiation has to be done over the normal network between you and the VPN server, then the Tun0 (or whatever) is created as a new (virtual?) interface. So if you can't connect to, or the negotiations fail with the VPN server Tun0 will never get created.

That's interesting. I'll be noting this down for future reference.

greerd wrote:Is there a way to get the actual ip of your home router just to test? This might help trouble shoot the issue.

Yep! As I said, my DDNS service just talks to my router and keeps my home IP updated at that address - so that no matter what is my home address, the DDNS service address will point to it. And so, like all web addresses, I can ping it to get the IP easily.

Cocohurtz
Level 1
Level 1
Posts: 8
Joined: Tue Oct 31, 2017 2:57 pm

Re: Missing TUN/TAP drivers?

Postby Cocohurtz » Fri Nov 17, 2017 2:39 pm

Quick update: I looked around a bit, and found this out:

The "Add VPN connection" option in my context menu for the network is grayed out. And I can't import, in any way or form, the openVPN configs into the network manager.

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Missing TUN/TAP drivers?

Postby greerd » Fri Nov 17, 2017 2:51 pm

Is network-manager-openvpn and network-manager-openvpn-gnome installed?
Image


Return to “Other networking topics”

Who is online

Users browsing this forum: No registered users and 1 guest