OpenVPN服务器,UDP端口不再可访问

我在OpenVPN有一个奇怪的问题。 服务器工作正常,没有修改很长一段时间,除了更新。 它突然停止工作,我不明白为什么。 我无法从domU或本地机器远程访问其UDP端口。 我可以达到所有其他服务。

我已经尝试禁用iptables作为一个实验,但我仍然无法到达端口。 我在OpenVPNconfiguration中看不到任何错误。 运行netstat -lp | grep openvpn netstat -lp | grep openvpn显示端口正在监听。 但是我甚至无法从本地机器访问它。

这是OpenVPNconfiguration: http : //pastebin.com/Gq8CDwVK

以下是iptables -nvL的输出: http : //pastebin.com/5MCqTWCE

以下是iptables -nvL -t nat的输出: http : //pastebin.com/XxFf0Kb4

我想我已经消除了所有可能的其他因素。 请帮我进一步诊断这个问题。

这是服务开始的日志…

 Tue Apr 28 07:04:39 2015 us=123021 OpenVPN 2.3.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Apr 27 2015 Tue Apr 28 07:04:39 2015 us=123031 library versions: OpenSSL 1.0.1l 15 Jan 2015, LZO 2.08 Tue Apr 28 07:04:39 2015 us=127292 Diffie-Hellman initialized with 2048 bit key Enter Private Key Password: Tue Apr 28 07:04:47 2015 us=695418 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this Tue Apr 28 07:04:47 2015 us=698002 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ] Tue Apr 28 07:04:47 2015 us=698025 Socket Buffers: R=[212992->131072] S=[212992->131072] Tue Apr 28 07:04:47 2015 us=698114 ROUTE_GATEWAY 167.114.15.64/255.255.255.0 IFACE=eth0 HWADDR=ba:e5:54:4f:ef:d7 Tue Apr 28 07:04:47 2015 us=698259 TUN/TAP device tun0 opened Tue Apr 28 07:04:47 2015 us=698294 TUN/TAP TX queue length set to 100 Tue Apr 28 07:04:47 2015 us=698317 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0 Tue Apr 28 07:04:47 2015 us=698340 /bin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500 Tue Apr 28 07:04:47 2015 us=699313 /bin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2 Tue Apr 28 07:04:47 2015 us=699853 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ] Tue Apr 28 07:04:47 2015 us=700326 GID set to openvpn Tue Apr 28 07:04:47 2015 us=700368 UID set to openvpn Tue Apr 28 07:04:47 2015 us=700394 UDPv4 link local (bound): [AF_INET]167.114.15.70:1194 Tue Apr 28 07:04:47 2015 us=700407 UDPv4 link remote: [undef] Tue Apr 28 07:04:47 2015 us=700422 MULTI: multi_init called, r=256 v=256 Tue Apr 28 07:04:47 2015 us=700460 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0 Tue Apr 28 07:04:47 2015 us=700480 ifconfig_pool_read(), in='client-johntate,10.8.0.4', TODO: IPv6 Tue Apr 28 07:04:47 2015 us=700498 succeeded -> ifconfig_pool_set() Tue Apr 28 07:04:47 2015 us=700511 ifconfig_pool_read(), in='client-lucasmarshall2,10.8.0.8', TODO: IPv6 Tue Apr 28 07:04:47 2015 us=700521 succeeded -> ifconfig_pool_set() Tue Apr 28 07:04:47 2015 us=700531 ifconfig_pool_read(), in='client-testuser4,10.8.0.12', TODO: IPv6 Tue Apr 28 07:04:47 2015 us=700543 succeeded -> ifconfig_pool_set() Tue Apr 28 07:04:47 2015 us=700556 IFCONFIG POOL LIST Tue Apr 28 07:04:47 2015 us=700570 client-obfuscated1,10.8.0.4 Tue Apr 28 07:04:47 2015 us=700582 client-obfuscated2,10.8.0.8 Tue Apr 28 07:04:47 2015 us=700593 client-obfuscated3,10.8.0.12 Tue Apr 28 07:04:47 2015 us=700632 Initialization Sequence Completed 

编辑:我做了进一步的testing,似乎系统无法听UDP的。 即使禁用了防火墙。 这根本没有任何意义。 为了testing我用socat来听UDP,并hping来testing它。

是VPS(OVH)@加拿大吗? 如果是这样,那么你应该联系你的支持。 你的设置对我来说完全正常。 根据iptables计数器转储操作系统内核不会收到任何@ openvpn的端口(1194 / UDP)。 它闻起来像我的连接问题。 这就是为什么openvpn不起作用。 你不能诊断它,只有你的提供者可以。 他们通常使用复杂的设置来降低成本,并提供最佳的公共IP地址分配。 那里犯了一些错误是很容易的。

Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination
15 3291 ACCEPT all -- * * 10.8.0.0/24 0.0.0.0/0
217M 74G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED 3155K 189M ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
53874 3814K DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID 357K 12M ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 8 ctstate NEW 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 305K 68M UDP udp -- * * 0.0.0.0/0 0.0.0.0/0 ctstate NEW 3802K 204M TCP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02 ctstate NEW 290K 67M REJECT udp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable 125K 6870K REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-proto-unreachable 0 0 sshguard all -- * * 0.0.0.0/0 0.0.0.0/0

你也可以提供ifconfig -a输出吗? 你也可以看看tcpdump / wireshark的输出。 它应该certificate我说的话。 你可以尝试以下面的方式find可用的udp端口:

@服务器

 tshark -i ethX udp or tshark -i ethX -f 'udp' depending on version 

@一些客户

 nmap -sU server's_IP_address -p 1-65535 

并观察输出@服务器。 这应该告诉你什么UDP端口打开。 要testingOpenVPN你可以切换到TCP,它将排除OpenVPN的configuration问题,并提供现在的备份连接。

还有祝你好运!