我刚刚在 VPS 上设置了一个 OpenVPN 服务器,但遗憾的是我无法连接到它。当我进行端口扫描时,我发现 openvpn 应该监听的自定义 11940 端口已关闭。默认 1194 端口也已关闭,唯一打开的其他相关端口(状态:已过滤)是 445 tcp 端口。
如果我手动启动 openvpn,我会收到以下消息:
hugo@nepomuk:~$ sudo openvpn --config /etc/openvpn/server.conf -verb 6
Fri Aug 3 16:42:27 2012 OpenVPN 2.2.1 i686-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Mar 30 2012
Fri Aug 3 16:42:27 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Fri Aug 3 16:42:27 2012 Diffie-Hellman initialized with 2048 bit key
Fri Aug 3 16:42:27 2012 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Fri Aug 3 16:42:27 2012 Socket Buffers: R=[163840->131072] S=[163840->131072]
Fri Aug 3 16:42:27 2012 ROUTE default_gateway=37.247.49.1
Fri Aug 3 16:42:27 2012 TUN/TAP device tun0 opened
Fri Aug 3 16:42:27 2012 TUN/TAP TX queue length set to 100
Fri Aug 3 16:42:27 2012 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Aug 3 16:42:27 2012 /sbin/ifconfig tun0 192.168.42.1 pointopoint 192.168.42.2 mtu 1500
Fri Aug 3 16:42:27 2012 /sbin/route add -net 192.168.42.0 netmask 255.255.255.0 gw 192.168.42.2
Fri Aug 3 16:42:27 2012 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Fri Aug 3 16:42:27 2012 UDPv4 link local (bound): [AF_INET]127.0.0.1:11940
Fri Aug 3 16:42:27 2012 UDPv4 link remote: [undef]
Fri Aug 3 16:42:27 2012 MULTI: multi_init called, r=256 v=256
Fri Aug 3 16:42:27 2012 IFCONFIG POOL: base=192.168.42.4 size=62, ipv6=0
Fri Aug 3 16:42:27 2012 IFCONFIG POOL LIST
Fri Aug 3 16:42:27 2012 Initialization Sequence Completed
那么 ROUTE default_gateway=37.247.49.1 呢,这一行 100% 是错误的,因为该 ip 与该服务器无关。
netstate 还列出了 openvpn:
hugo@nepomuk:~$ sudo netstat -uapn | grep openvpn
udp 0 0 127.0.0.1:11940 0.0.0.0:* 1314/openvpn
谢谢您提供任何关于如何继续的提示!