openvpn多设备连接

2013-05-29 13:55:21 +08:00
 yadizzz
serverconfig上默认max clients说是1024,可是电脑和手机一直没法同时连接,改成100也还是不行,config文件如下:
local xxx.xxx.xxx.xxx
port 110
proto tcp
dev tun
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
client-to-client
keepalive 10 120
max-clients 100
comp-lzo
persist-key
persist-tun
status /etc/openvpn/easy-rsa/2.0/keys/openvpn-status.log
verb 4
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

所以多设备连接和maxclients有没有关系呢?
6565 次点击
所在节点    问与答
4 条回复
tarsier
2013-05-29 14:11:45 +08:00
# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100
我觉得是指多个设备采用不同的key文件登陆吧

如果你手机跟电脑才用同一个key文件,我觉得应该是server端的duplicate-cn选项
yadizzz
2013-05-29 14:18:05 +08:00
@tarsier nice!可以了!
ooxxcc
2013-05-29 14:20:13 +08:00
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

谁让你直接复制别人的配置文件,而不是从sample改。。。
yadizzz
2013-05-29 14:28:50 +08:00
@ooxxcc 有道理!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/70517

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX