Aus*_*tin 7 networking vpn vps routing openvpn
我最近在我的 Ubuntu VPS 上安装了 OpenVPN。每当我尝试连接到它时,我都可以很好地建立连接。
但是,我尝试连接的所有内容都超时。
如果我尝试 ping 某些东西,它会解析 IP,但会在解析 IP 后超时。(所以 DNS 服务器似乎工作正常)
我的 server.conf 有这个相关信息(至少我认为它是相关的。我不确定你是否需要更多)
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
;push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
;client-to-client
;duplicate-cn
keepalive 10 120
;tls-auth ta.key 0 # This file is secret
comp-lzo
persist-key
persist-tun
status openvpn-status.log
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3
Run Code Online (Sandbox Code Playgroud)
顺便说一下,我已经在多台计算机上尝试过。他们所有人的结果都是一样的。
可能有什么问题?
提前致谢,如果您需要其他信息,我很乐意发布。
新评论的信息
root@vps:~# iptables -L -n -v
Chain INPUT (policy ACCEPT 862K packets, 51M bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 3 packets, 382 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
4641 298K ACCEPT all -- * * 10.8.0.0/24 0.0.0.0/0
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 1671K packets, 2378M bytes)
pkts bytes target prot opt in out source destination
Run Code Online (Sandbox Code Playgroud)
和
root@vps:~# iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 17937 packets, 2013K bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 8975 packets, 562K bytes)
pkts bytes target prot opt in out source destination
1579 103K SNAT all -- * * 10.8.0.0/24 0.0.0.0/0 to:SERVERIP
Chain OUTPUT (policy ACCEPT 8972 packets, 562K bytes)
pkts bytes target prot opt in out source destination
Run Code Online (Sandbox Code Playgroud)
因此,您在 conf 中缺少的是 - 路由。
入口是这样的:
;push "路由 192.168.10.0 255.255.255.0"
被注释到您的配置文件中。这解释了为什么您获得 IP 但无法 ping,因为您的配置文件中没有路由信息。
取消注释此行并将 IP 信息替换为运行 openvpn 服务器的网关的 IP。
一旦你这样做了,你的问题应该得到解决。
归档时间: |
|
查看次数: |
3134 次 |
最近记录: |