Open×××服务端的搭建:http://qicheng0211.blog.51cto.com/3958621/1575273
Open×××应用案例:http://qicheng0211.blog.51cto.com/3958621/1840316
CentOS下Open×××客户端配置
安装epel yum源:
shell> rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm shell> sed -i 's/^mirrorlist=https/mirrorlist=http/' /etc/yum.repos.d/epel.repo
yum安装open***,这里安装的版本是open***-2.3.11-1.el6.x86_64:
shell> yum -y install open***
安装好Open×××后,客户端不需要特别配置,只要将服务器上生成的证书和客户端配置文件拷贝到客户端配置目录中。下面是所需的文件列表:
文件 | 部署位置 | 目的 | 保密 |
client.o*** | all clients | client configuration file | NO |
ca.crt | server + all clients | Root CA certificate | NO |
client1.crt | client1 only | Client1 Certificate | NO |
client1.key | client1 only | Client1 Key | YES |
ta.key | server + all clients | tls-auth | YES |
客户端配置文件client.o***:
client dev tun # 路由模式,跟服务端配置一致 proto tcp # TCP协议,跟服务端配置一致 remote xxx.xxx.xxx.xxx 1194 # open***服务端的公网的IP和端口 resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert client1.crt # 客户端client1的证书文件 key client1.key # 客户端client1的密钥文件 remote-cert-tls server tls-auth ta.key 1 comp-lzo verb 3
将上述客户端配置文件都上传在同一个目录下,比如:/etc/open***/。
从后台启动Open×××客户端,Open×××日志输出到/var/log/open***.log:
shell> open*** --daemon --cd /etc/open*** --config client.o*** --log-append /var/log/open***.log
参数解释:
--daemon : open***以daemon方式启动
--cd dir : 配置文件的目录,open***初始化前,先切换到此目录
--config file : 客户端配置文件的路径
--log-append file : 日志文件路径,如果文件不存在会自动创建
启动后观察连接日志,确定是否连接成功。
最后可以将上述命令加到/etc/rc.local里开机启动。
转载于:https://blog.51cto.com/qicheng0211/1840055