Openvpn: Write to Tun/tap : Invalid Argument (Code=22)

Home Forums Reviews Tutorials Articles Register
Go Back LinuxQuestions.org > Forums > Linux Forums > Linux - Server
Reload this Page OpenVpn TUN/TAP
User Name
Password

Linux - Server This forum is for the discussion of Linux Software used in a server related context.


Notices

Reply

Search this Thread
Old 05-08-2010, 02:17 PM #1

unminser

LQ Newbie

Registered: May 2010

Posts: 24

Rep: Reputation: 15

OpenVpn TUN/TAP


i installed the openvpn and now try to run it but:

Code:

[root@server openvpn]# /usr/sbin/openvpn  server.conf Sat May  8 13:15:51 2010 OpenVPN 2.1.1 x86_64-redhat-linux [SSL] [LZO2] [EPOLL] [PKCS11] built on May  8 2010 Sat May  8 13:15:51 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables Sat May  8 13:15:51 2010 Diffie-Hellman initialized with 1024 bit key Sat May  8 13:15:51 2010 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ] Sat May  8 13:15:51 2010 ROUTE default_gateway=191.255.255.1 Sat May  8 13:15:51 2010 Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13) Sat May  8 13:15:51 2010 Note: Attempting fallback to kernel 2.2 TUN/TAP interface Sat May  8 13:15:51 2010 Cannot allocate TUN/TAP dev dynamically Sat May  8 13:15:51 2010 Exiting
Old 05-09-2010, 07:14 AM #2

catkin

LQ 5k Club

Registered: Dec 2008

Location: Tamil Nadu, India

Distribution: Debian

Posts: 8,578

Blog Entries: 31

Rep: Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198

What is the output of

Code:

ls -l /dev/net/tun lsmod | grep tun
Old 05-09-2010, 10:20 AM #3

unminser

LQ Newbie

Registered: May 2010

Posts: 24

Original Poster

Rep: Reputation: 15

Code:

[root@server /]# ls -l /dev/net/tun crw------- 1 root root 10, 200 May  7 21:51 /dev/net/tun [root@dok /]# lsmod | grep tun bash: lsmod: command not found [root@server /]#
Old 05-09-2010, 10:51 AM #4

catkin

LQ 5k Club

Registered: Dec 2008

Location: Tamil Nadu, India

Distribution: Debian

Posts: 8,578

Blog Entries: 31

Rep: Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198

Quote:

Originally Posted by unminser View Post

Code:

[root@server /]# ls -l /dev/net/tun crw------- 1 root root 10, 200 May  7 21:51 /dev/net/tun [root@dok /]# lsmod | grep tun bash: lsmod: command not found [root@server /]#

Strange; no lsmod command? Maybe RedHat has another way to list modules loaded into the kernel. Maybe try /sbin/lsmod. I'm guessing the underlying problem is tun is not in the kernel.

Old 05-09-2010, 11:19 AM #5

unminser

LQ Newbie

Registered: May 2010

Posts: 24

Original Poster

Rep: Reputation: 15

Code:

[root@server /]# find -name lsmod ./sbin/lsmod [root@server /]# ./sbin/lsmod | grep tun [root@server /]# [root@server /]# find -name tun ./dev/net/tun [root@server /]#

im using centos 5.?.?

Old 05-09-2010, 11:41 AM #6

catkin

LQ 5k Club

Registered: Dec 2008

Location: Tamil Nadu, India

Distribution: Debian

Posts: 8,578

Blog Entries: 31

Rep: Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198

Quote:

Originally Posted by unminser View Post

Code:

[root@server /]# find -name lsmod ./sbin/lsmod [root@server /]# ./sbin/lsmod | grep tun [root@server /]# [root@server /]# find -name tun ./dev/net/tun [root@server /]#

im using centos 5.?.?

Seems you have an unusual $PATH for root -- it usually includes /sbin. For interest echo $PATH

The was no output from ./sbin/lsmod | grep tun showing the tun module was not loaded. Presuming tun is not built in to the kernel that might be enough to explain the symptoms. IDK how to load modules in RedHat but this page looks helpful. Looks like you just need to run /sbin/modprobe tun and, if it works OK (confirm with lsmod), try OpenVPN again.

Old 05-09-2010, 11:58 AM #7

unminser

LQ Newbie

Registered: May 2010

Posts: 24

Original Poster

Rep: Reputation: 15

Code:

[root@server /]# echo $PATH /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/rabbit/bin [root@server  /]# ./sbin/lsmod | grep tun [root@server  /]# /sbin/modprobe tun FATAL: Could not load /lib/modules/2.6.18-028stab067.4/modules.dep: No such file or directory [root@server  /]# ./sbin/modprobe tun FATAL: Could not load /lib/modules/2.6.18-028stab067.4/modules.dep: No such file or directory [root@server  /]#
Old 05-09-2010, 12:11 PM #8

catkin

LQ 5k Club

Registered: Dec 2008

Location: Tamil Nadu, India

Distribution: Debian

Posts: 8,578

Blog Entries: 31

Rep: Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198

Quote:

Originally Posted by unminser View Post

Code:

[root@server /]# echo $PATH /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/rabbit/bin [root@server  /]# ./sbin/lsmod | grep tun [root@server  /]# /sbin/modprobe tun FATAL: Could not load /lib/modules/2.6.18-028stab067.4/modules.dep: No such file or directory [root@server  /]# ./sbin/modprobe tun FATAL: Could not load /lib/modules/2.6.18-028stab067.4/modules.dep: No such file or directory [root@server  /]#

/sbin/modprobe tun is the correct form of the command. ./sbin/modprobe tun is equivalent if the current directory is /

Unless tun is built into the kernel then the problem is that it is not available as a loadable module. IDK RedHat so do not know how to resolve that. How about a new thread asking how to load tun in RedHat (and giving the RedHat release)?

Old 05-09-2010, 12:17 PM #9

unminser

LQ Newbie

Registered: May 2010

Posts: 24

Original Poster

Rep: Reputation: 15

Code:

uname -a Linux server 2.6.18-028stab067.4 #1 SMP Thu Jan 14 17:06:11 MSK 2010 x86_64 x86_64 x86_64 GNU/Linux
Old 05-09-2010, 12:52 PM #10

catkin

LQ 5k Club

Registered: Dec 2008

Location: Tamil Nadu, India

Distribution: Debian

Posts: 8,578

Blog Entries: 31

Rep: Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198 Reputation: 1198

Quote:

Originally Posted by unminser View Post

Code:

uname -a Linux server 2.6.18-028stab067.4 #1 SMP Thu Jan 14 17:06:11 MSK 2010 x86_64 x86_64 x86_64 GNU/Linux

That's the kernel. Do you have an /etc/*release* or /etc/*version* file that shows the version/release of RedHat? With that information we should be able to netsearch for how tun is normally set up. The fact that you have a /dev/net/tun file suggests it's in there somewhere.

Old 05-09-2010, 12:57 PM #11

unminser

LQ Newbie

Registered: May 2010

Posts: 24

Original Poster

Rep: Reputation: 15

im new to linux i thought uname -a give the system inofrmation

Quote:

CentOS release 5.4 (Final)

Old 05-29-2011, 04:00 AM #12

mselvaprakash

LQ Newbie

Registered: Oct 2010

Posts: 7

Rep: Reputation: 0

Thumbs up


Please refer the below URL:

http://unixnethost.blogspot.com/2011...tallation.html


Reply

Posting Rules

You may not post new threads

You may not post replies

You may not post attachments

You may not edit your posts


BB code is On

Smilies are On

[IMG] code is Off

HTML code is Off


Forum Rules


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenVPN Tun/Tap error Penn Linux - Server 5 10-14-2010 03:35 PM
nm-openvpn write to TUN/TAP : Invalid argument (code=22) jonaskellens Linux - Newbie 0 08-24-2009 04:49 AM
OpenVPN - tun - tap - tunnels leamassiot Linux - Networking 40 08-12-2009 10:36 AM
Need help on TUN/TAP vinodl Linux - Networking 1 06-22-2009 12:18 PM
Tun/Tap issue minasafwat Linux - Kernel 0 11-14-2006 02:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:44 PM.


Contact Us - Advertising Info - Rules - Privacy - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -

Main Menu
  • Linux Forum
  • Search
  • LQ Tags
  • Linux Tutorials
  • LQ Job Marketplace
  • LQ Deals
  • Linux Wiki
  • Distro Reviews
  • Book Reviews
  • Download Linux
  • Social Groups
  • LQ Blogs

(Con't)

Advertisement

My LQ
  • Login
  • Register
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
  • LQ Calendar
  • LQ Rules
  • LQ Sitemap
  • Site FAQ
  • View New Posts
  • View Latest Posts
  • Zero Reply Threads
  • LQ Wiki Most Wanted
  • Jeremy's Blog
  • Report LQ Bug
Syndicate
RSS1  Latest Threads
RSS1  LQ News

Twitter: @linuxquestions

Openvpn: Write to Tun/tap : Invalid Argument (Code=22)

Source: https://www.linuxquestions.org/questions/linux-server-73/openvpn-tun-tap-806675/

0 Response to "Openvpn: Write to Tun/tap : Invalid Argument (Code=22)"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel