我目前正在运行 debian squeeze 的 arm 微处理器上配置 OpenVPN 客户端,但是遇到了问题。
如下所示,/dev/net/tun 存在:
debarm:~# whoami
root
debarm:~# cd /dev/net
debarm:/dev/net# ls -lah
total 0
drwxr-xr-x 2 root root 60 Jul 23 16:26 .
drwxr-xr-x 13 root root 3.7K Jul 23 16:27 ..
crw-rw-rw- 1 root root 10, 200 Jul 23 16:26 tun
但是当我尝试启动 OpenVPN 时,它会抛出一个错误:
debarm:/dev/net# openvpn /root/2738.ovpn
Thu Jul 23 16:29:31 2015 OpenVPN 2.1.3 arm-unknown-linux-gnueabi [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jun 6 2013
Thu Jul 23 16:29:31 2015 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Thu Jul 23 16:29:31 2015 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Thu Jul 23 16:29:31 2015 /usr/bin/openssl-vulnkey -q -b 2048 -m <modulus omitted>
Thu Jul 23 16:29:36 2015 LZO compression initialized
Thu Jul 23 16:29:36 2015 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Thu Jul 23 16:29:36 2015 Socket Buffers: R=[112640->131072] S=[112640->131072]
Thu Jul 23 16:29:36 2015 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu Jul 23 16:29:36 2015 Local Options hash (VER=V4): '41690919'
Thu Jul 23 16:29:36 2015 Expected Remote Options hash (VER=V4): '530fdded'
Thu Jul 23 16:29:36 2015 UDPv4 link local: [undef]
Thu Jul 23 16:29:36 2015 UDPv4 link remote: [AF_INET]82.165.45.40:1194
Thu Jul 23 16:29:36 2015 TLS: Initial packet from [AF_INET]82.165.45.40:1194, sid=7151f8a2 4b0e9dab
Thu Jul 23 16:29:37 2015 VERIFY OK: depth=1, /C=GB/ST=London/L=London/O=xxxxx/OU=server/CN=xxxxx/name=server/emailAddress=xxxxxk
Thu Jul 23 16:29:37 2015 VERIFY OK: depth=0, /C=GB/ST=London/L=London/O=xxxxx/OU=server/CN=server/name=server/emailAddress=xxxxx
Thu Jul 23 16:29:39 2015 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Jul 23 16:29:39 2015 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Jul 23 16:29:39 2015 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Jul 23 16:29:39 2015 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Jul 23 16:29:39 2015 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Thu Jul 23 16:29:39 2015 [server] Peer Connection Initiated with [AF_INET]82.165.45.40:1194
Thu Jul 23 16:29:42 2015 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Thu Jul 23 16:29:42 2015 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.14 10.8.0.13'
Thu Jul 23 16:29:42 2015 OPTIONS IMPORT: timers and/or timeouts modified
Thu Jul 23 16:29:42 2015 OPTIONS IMPORT: --ifconfig/up options modified
Thu Jul 23 16:29:42 2015 OPTIONS IMPORT: route options modified
Thu Jul 23 16:29:42 2015 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Thu Jul 23 16:29:42 2015 ROUTE default_gateway=192.168.100.1
Thu Jul 23 16:29:42 2015 Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Thu Jul 23 16:29:42 2015 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Thu Jul 23 16:29:42 2015 Cannot allocate TUN/TAP dev dynamically
Thu Jul 23 16:29:42 2015 Exiting
同样,如果我尝试对其进行 modprobe,我会收到错误,但我认为这与 tun 现在是编译而不是内核模块有关
debarm:/dev/net# modprobe tun
FATAL: Module tun not found.
有人能否提出一个可能出现这种情况的原因,并最好提供一个解决方案!:-)
谢谢!
答案1
文件 /dev/net/tun(字符设备)的存在不等于名为“tun”的内核模块的存在。
解决方法:将tun设备添加到内核配置中,然后重新编译内核。
检查当前模块状态:lsmod | grep tun
。