我有一个连接到Debian OpenVPN服务器的Ubuntu客户端OpenVPN。
有一阵子,我使用udp在默认端口1194上安装了它,而我是从没有过滤我的连接的网络进行连接的。一切正常。
然后,我需要从仅允许端口80和443的网络连接到它,因此我将配置切换为在端口443上使用tcp。再次运行很好。
现在,我在另一个未直接连接到Internet的网络上,可以使用的访问是http代理。因此,我在客户端上切换了配置以使用http代理。从那时起,连接是草率的。它已连接到服务器,并且在短时间内连接似乎可以正常工作(我可以访问Internet上的所有端口,可以ping通...),然后突然断开连接。如果我什么也不做,则连接不会断开!它会在某些数据包通过后掉线,因此,如果执行ssh,我有一段时间才能掉线,但是如果我尝试加载网页,则掉线会很快。我使用ubuntu网络管理器进行配置。路线还可以,一切都按预期进行。
编辑1:我在同一台服务器上也有一个www服务器。可能是OpenVPN收到了一些不想要的数据包,但我使用了“共享端口”选项,该选项会将所有这些数据包重定向到www服务器。
据我了解,TCP数据包可能会在传输过程中被破坏(很可能是由HTTP代理破坏),这会破坏HMAC。
编辑2:运行Zenmap我可以看到代理是鱿鱼,操作系统是MikroTik。
编辑3:只是为了好玩,我试图在第一个上运行另一个openVPN,第二个配置为使用UDP。但是,在重新配置路由并尝试加载网页后,第一个始终以相同的方式崩溃。
编辑4:我已经在服务器上安装了sslh来充当端口443上的多路复用器,因此当它收到ssh或openvpn或https的流量时,会将其重定向到相应的服务,现在我正尝试通过ssh连接,这要归功于corkscrew,但是也会失败(连接被远程主机关闭,服务器实际上收到了连接但将其丢弃)。
编辑5:由于我已经通过DNS服务器使用iodine设置了隧道,因此我能够通过ssh配置服务器。听起来很愚蠢,但实际上效果很好且非常稳定,唯一的问题是它非常慢,仅够ssh。
编辑6:我可以访问另一个可以立即使用的HTTP代理,它非常稳定,因此我现在将继续使用它。我仍然不知道第一个有什么问题。
客户端上的日志显示:(所有这些操作均在不到2分钟的时间内启用了vpn并加载了一半的网页)
NetworkManager[1249]: <info> Starting VPN service 'openvpn'...
NetworkManager[1249]: <info> VPN service 'openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 12305
NetworkManager[1249]: <info> VPN service 'openvpn' appeared; activating connections
NetworkManager[1249]: <info> VPN plugin state changed: starting (3)
NetworkManager[1249]: <info> VPN connection 'domain.com' (Connect) reply received.
nm-openvpn[12311]: OpenVPN 2.2.1 i686-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Feb 13 2013
nm-openvpn[12311]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
nm-openvpn[12311]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
nm-openvpn[12311]: WARNING: file '/home/user/openvpn-client-conf/ta.key' is group or others accessible
nm-openvpn[12311]: Control Channel Authentication: using '/home/user/openvpn-client-conf/ta.key' as a OpenVPN static key file
nm-openvpn[12311]: LZO compression initialized
nm-openvpn[12311]: Attempting to establish TCP connection with [AF_INET]x.x.x.x:xxxx(http proxy) [nonblock]
nm-openvpn[12311]: TCP connection established with [AF_INET]x.x.x.x:xxxx(http proxy)
nm-openvpn[12311]: TCPv4_CLIENT link local: [undef]
nm-openvpn[12311]: TCPv4_CLIENT link remote: [AF_INET]x.x.x.x:xxxx(http proxy)
nm-openvpn[12311]: [domain.com] Peer Connection Initiated with [AF_INET]x.x.x.x:xxxx(http proxy)
nm-openvpn[12311]: TUN/TAP device tun0 opened
nm-openvpn[12311]: /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper tun0 1500 1544 10.8.0.2 255.255.255.0 init
NetworkManager[1249]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
NetworkManager[1249]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
NetworkManager[1249]: <warn> /sys/devices/virtual/net/tun0: couldn't determine device driver; ignoring...
NetworkManager[1249]: <info> VPN connection 'domain.com' (IP4 Config Get) reply received from old-style plugin.
NetworkManager[1249]: <info> VPN Gateway: x.x.x.x(http proxy)
NetworkManager[1249]: <info> Tunnel Device: tun0
NetworkManager[1249]: <info> IPv4 configuration:
NetworkManager[1249]: <info> Internal Gateway: 10.8.0.1
NetworkManager[1249]: <info> Internal Address: 10.8.0.2
NetworkManager[1249]: <info> Internal Prefix: 24
NetworkManager[1249]: <info> Internal Point-to-Point Address: 0.0.0.0
NetworkManager[1249]: <info> Maximum Segment Size (MSS): 0
NetworkManager[1249]: <info> Forbid Default Route: no
NetworkManager[1249]: <info> Internal DNS: x.x.x.x(dns server)
NetworkManager[1249]: <info> DNS Domain: '(none)'
NetworkManager[1249]: <info> No IPv6 configuration
nm-openvpn[12311]: Initialization Sequence Completed
NetworkManager[1249]: <info> VPN connection 'domain.com' (IP Config Get) complete.
NetworkManager[1249]: <info> Policy set 'domain.com' (tun0) as default for IPv4 routing and DNS.
NetworkManager[1249]: <info> Writing DNS information to /sbin/resolvconf
dbus[975]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
NetworkManager[1249]: <info> VPN plugin state changed: started (4)
dbus[975]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
ntpdate[12428]: step time server 84.104.189.253 offset 1.749623 sec
nm-openvpn[12311]: Authenticate/Decrypt packet error: packet HMAC authentication failed
nm-openvpn[12311]: Fatal decryption error (process_incoming_link), restarting
nm-openvpn[12311]: SIGUSR1[soft,decryption-error] received, process restarting
nm-openvpn[12311]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
nm-openvpn[12311]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
nm-openvpn[12311]: Re-using SSL/TLS context
nm-openvpn[12311]: LZO compression initialized
nm-openvpn[12311]: Attempting to establish TCP connection with [AF_INET]x.x.x.x:xxxx(http proxy) [nonblock]
nm-openvpn[12311]: TCP connection established with [AF_INET]x.x.x.x:xxxx(http proxy)
nm-openvpn[12311]: TCPv4_CLIENT link local: [undef]
nm-openvpn[12311]: TCPv4_CLIENT link remote: [AF_INET]x.x.x.x:xxxx(http proxy)
nm-openvpn[12311]: [domain.com] Peer Connection Initiated with [AF_INET]x.x.x.x:xxxx(http proxy)
nm-openvpn[12311]: Preserving previous TUN/TAP instance: tun0
nm-openvpn[12311]: /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper tun0 1500 1544 10.8.0.2 255.255.255.0 restart
NetworkManager[1249]: <warn> VPN plugin failed: 2
nm-openvpn[12311]: WARNING: Failed running command (--up/--down): external program exited with error status: 1
nm-openvpn[12311]: Exiting
avahi-daemon[1176]: Withdrawing workstation service for tun0.
NetworkManager[1249]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
NetworkManager[1249]: <warn> VPN plugin failed: 1
NetworkManager[1249]: <info> VPN plugin state changed: stopped (6)
NetworkManager[1249]: <info> VPN plugin state change reason: 0
avahi-daemon[1176]: Withdrawing address record for x.x.x.x(local ip) on eth0.
avahi-daemon[1176]: Leaving mDNS multicast group on interface eth0.IPv4 with address x.x.x.x(local ip).
avahi-daemon[1176]: Joining mDNS multicast group on interface eth0.IPv4 with address x.x.x.x(second local ip).
avahi-daemon[1176]: Withdrawing address record for x.x.x.x(second local ip) on eth0.
avahi-daemon[1176]: Leaving mDNS multicast group on interface eth0.IPv4 with address x.x.x.x(second local ip).
avahi-daemon[1176]: Interface eth0.IPv4 no longer relevant for mDNS.
avahi-daemon[1176]: Joining mDNS multicast group on interface eth0.IPv4 with address x.x.x.x(local ip).
avahi-daemon[1176]: New relevant interface eth0.IPv4 for mDNS.
avahi-daemon[1176]: Registering new address record for x.x.x.x(local ip) on eth0.IPv4.
avahi-daemon[1176]: Registering new address record for x.x.x.x(second local ip) on eth0.IPv4.
NetworkManager[1249]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
NetworkManager[1249]: <info> Writing DNS information to /sbin/resolvconf
dbus[975]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
NetworkManager[1249]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
NetworkManager[1249]: <warn> (7) failed to find interface name for index
NetworkManager[1249]: nm_system_iface_flush_routes: assertion `iface != NULL' failed
NetworkManager[1249]: <warn> (7) failed to find interface name for index
dbus[975]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
NetworkManager[1249]: <info> VPN service 'openvpn' disappeared