Mac OS配置OpenVPN之Tunnelblick
链接公司内网需要使用到OpenVPN,之前在Windows系统直接使用公司提供的OpenVPN客户端,但是似乎没有Mac版,所以使用了Tunnelblick工具,下边记录一下在使用中遇到的一些问题。
下载⏬Tunnelblick工具,安装
准备
*.ovpn
、*.key
、*.crt
在同一目录下问题一:
“comp-lzo” 在openvpn 2.4 中已弃用,将会在未来的版本中移除。
解决:https://github.com/Nyr/openvpn-install/issues/430
在
*.ovpn
使用compress lzo
代替comp-lzo
问题二:
• 'ns-cert-type' 这个选项在 OpenVPN 2.4 版本的配置中是过时的,已经在 OpenVPN 2.5 版本中移除。
解决:在
*.ovpn
使用remote-cert-tls server
代替ns-cert-type server
问题三:
unrecognized option or missing or extra parameter(s) ip-win32 (2.4.7)
解决:由于脚本是公司为Windows系统提供的,所以我在这里直接注释这个。
# ip-win32 dynamic -1 # route-method exe
点击
*.ovpn
、连接
==OpenVPN中不推荐使用的选项==:https://community.openvpn.net/openvpn/wiki/DeprecatedOptions
OpenVPN客户端配置文件详解:https://blog.faystar.com/openvpn_client/
# 定义是一个客户端
client
# 定义使用设备类型,与服务端一致
;dev tap
dev tun
# 定义Windows下使用的网卡名称,linux不需要
;dev-node 我的连接
# 定义使用的协议,与服务端一致
;proto tcp
proto udp
# 指定服务端地址和端口,可以用多行指定多台服务器
# 实现负载均衡(从上往下尝试)
remote 118.112.188.108 1194
;remote my-server-2 1194
# 若上面配置了多台服务器,让客户端随机连接
;remote-random
# 解析服务器域名
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
# 客户端不需要绑定端口
# Most clients do not need to bind to
# a specific local port number.
nobind
# 也是为了让Openvpn也nobody运行(安全)
# 注意:Windows不能设置
;user nobody
;group nobody
# Try to preserve some state across restarts.
persist-key
persist-tun
# 若客户端通过HTTP Proxy,在这里设置
# 要使用Proxy,不能使用UDP为VPN的通讯协议
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
# 无线网络有很多多余的头文件,设置忽略它
;mute-replay-warnings
# 重点,就是指定ca和客户端的证书
# 注意,下面的两个号是连在一起的,之间没有空格.需同时存在/注释
ca "ca.crt"
# cert "test-1.crt"
# key "test-1.key"
# 如果服务端打开了PAM认证模块,如mysql,LDAP数据库验证,客户端需要另其有效
;auth-user-pass
# 一些安全措施
# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to “server”. This is an
# important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to “server”. The build-key-server
# script in the easy-rsa folder will do this.
remote-cert-tls server
# 增强验证加密,如果你在服务器端生成了ta.key,那么这里就需要加上
# then every client must also have the key.
tls-auth ta.key 1
# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
;cipher x
# 使用lzo压缩,与服务端一致
compress lzo
# Set log file verbosity.
verb 3
# Silence repeating messages
;mute 20
#采用用户名密码方式验证,若不用证书的话,可以考虑这种方式,可以结合LDAP或者mysql
;auth-user-pass
#windows7上会报错,建议加上此行
# route-method exe
#强行指定添加路由前的延时
route-delay 2
#不存储验证缓存
auth-nocache
#设置IP地址过期时间
# ip-win32 dynamic 0 7200
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 tuyrk@qq.com
文章标题:Mac OS配置OpenVPN之Tunnelblick
文章字数:891
本文作者:神秘的小岛岛
发布时间:2019-10-10, 11:23:59
最后更新:2019-11-05, 17:46:33
原始链接:https://www.tuyrk.cn/MacOS-OpenVPN/版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。