OpenVPN是个不错的工具
安装epel源
安装
配置过程
添加服务器配置
启动
客户端配置文件
客户端安装openvpn客户端
http://openvpn.ustc.edu.cn/
Installer (32-bit), Windows XP openvpn-install-2.3.10-I001-i686.exe
Installer (64-bit), Windows XP openvpn-install-2.3.10-I001-x86_64.exe
Installer (32-bit), Windows Vista and later openvpn-install-2.3.10-I601-i686.exe
Installer (64-bit), Windows Vista and later openvpn-install-2.3.10-I601-x86_64.exe
将证书和配置文件放到OpenVPN\config文件夹下
ca.crt
client.crt
client.key
client.ovpn
打开VPN连接即可
安装epel源
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
安装
yum install openvpn easy-rsa
配置过程
cd /etc/openvpn cp -rv /usr/share/easy-rsa/ ./ vi /etc/openvpn/easy-rsa/2.0/vars source vars ./clean-all ./build-ca ./build-key-server server ./build-key client1 ./build-dh 生成 dm2048 信息
#vi /etc/openvpn/easy-rsa/2.0/vars 修改以下变量 export KEY_COUNTRY="CN" export KEY_PROVINCE="bj" export KEY_CITY="bj" export KEY_ORG="someorg" export KEY_EMAIL="me@myhost.mydomain" export KEY_OU="MyOrganizationalUnit" #变量生效 source vars
#./build-key-server server ./build-key-server server Generating a 2048 bit RSA private key .....+++ ......................+++ writing new private key to 'server.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [CN]: State or Province Name (full name) [bj]: Locality Name (eg, city) [bj]: Organization Name (eg, company) [someorg]: Organizational Unit Name (eg, section) [MyOrganizationalUnit]: Common Name (eg, your name or your server's hostname) [server]: Name [EasyRSA]: Email Address [me@myhost.mydomain]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Using configuration from /etc/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'CN' stateOrProvinceName :PRINTABLE:'bj' localityName :PRINTABLE:'bj' organizationName :PRINTABLE:'someorg' organizationalUnitName:PRINTABLE:'MyOrganizationalUnit' commonName :PRINTABLE:'server' name :PRINTABLE:'EasyRSA' emailAddress :IA5STRING:'me@myhost.mydomain' Certificate is to be certified until Mar 27 06:38:24 2026 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated
添加服务器配置
cp /usr/share/doc/openvpn-2.3.10/sample/sample-config-files/server.conf /etc/openvpn #将server.conf改为如下内容 port 443 #使用443 https端口以免被防火墙封端口 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/dh2048.pem server 172.16.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt client-to-client keepalive 10 120 comp-lzo user nobody group nobody persist-key persist-tun status openvpn-status.log verb 3
启动
/usr/sbin/openvpn --config /etc/openvpn/server.conf &
打包三个证书到本地 ca.crt client.crt client.key zip client.zip ca.crt client.crt client.key
客户端配置文件
#client.ovpn client dev tun proto tcp remote remoteserver 443 #服务器IP resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert client.crt key client.key remote-cert-tls server comp-lzo verb 3
客户端安装openvpn客户端
http://openvpn.ustc.edu.cn/
Installer (32-bit), Windows XP openvpn-install-2.3.10-I001-i686.exe
Installer (64-bit), Windows XP openvpn-install-2.3.10-I001-x86_64.exe
Installer (32-bit), Windows Vista and later openvpn-install-2.3.10-I601-i686.exe
Installer (64-bit), Windows Vista and later openvpn-install-2.3.10-I601-x86_64.exe
将证书和配置文件放到OpenVPN\config文件夹下
ca.crt
client.crt
client.key
client.ovpn
打开VPN连接即可
发表评论
-
linux 安装mysql多个实例
2020-03-13 15:47 439mysql5.7.28多实例 安装mysql,不要启动 创 ... -
批量替换配置文件中的URL
2020-03-11 13:35 373find -iregex ".*/sh[a-z ... -
rsync备份和删除指定文件
2018-01-02 10:23 2084文件异地备份时,需要将本地文件合并到服务器上,且不能删除服务器 ... -
linux 定时任务crontab操作
2017-12-28 16:14 649常用参数: crontab -l //查看当前用户下 ... -
iptables 日志
2017-11-15 15:06 1472centos6.5配置了iptables的nat功能,但是不知 ... -
linux删除乱码文件
2017-09-30 11:20 696系统里好多乱码文件,删除不了 这个办法挺好 [url=htt ... -
解决vsftpd中文乱码问题
2017-08-25 10:45 0vsftpd中文乱码,通过ftp工具上传的中文文件会变为乱码J ... -
LVM常用命令
2017-08-25 10:28 640lvm 查看命令 lvs vgs pvs vgdisplay ... -
Centos7 firewalld操作
2017-08-25 10:27 661启动:# systemctl start firewall ... -
centos 添加DNAT SNAT
2017-08-25 10:19 3449外网服务器IP 101.168.200.22 开放端口8310 ... -
centos6.5 配置PXE系统
2017-08-25 09:58 750参考https://linux.cn/article-4902 ... -
centos6 tomcat 启动脚本 tomcat服务
2017-08-23 11:24 1454系统自动启动tomcat 复制该脚本到/etc/init.d/ ... -
CentOS6.5 整机备份与迁移恢复 五
2017-07-10 14:44 859修改网卡等配置 B服务器启动后,由于权限等原因会导至部分功能出 ... -
CentOS6.5 整机备份与迁移恢复 四
2017-07-07 16:52 896修改B系统引导器,正常启动B系统 选择系统安装或更新 ... -
CentOS6.5 整机备份与迁移恢复 三
2017-07-07 16:41 1069恢复系统文件 使用光盘启动B服务器,进入rescue模式,进入 ... -
CentOS6.5 整机备份与迁移恢复 二
2017-07-07 16:05 1176恢复分区表和格式化分区 在B服务器上,使用同样的系统盘启动系统 ... -
CentOS6.5 整机备份与迁移恢复 一
2017-07-07 15:32 7652CentOS6.5的整机备份与迁 ... -
centos vsftpd 虚拟用户安装配置
2017-07-07 14:11 657安装vsftpd yum install -y vsftp ... -
openstack 虚拟机改IP
2017-03-31 17:17 1692虚拟环境搭建好以后,需要把实体服务器切换到虚拟机中,为了 ... -
编译安装openstack mitaka horizon
2017-03-15 15:19 1658由于openstack的rpm包 ...
相关推荐
FastDFS一键安装脚本centOS6.x 一键搭建单机版fastDFS - 1.FastDFS_v5.08.tar.gz - 2.fastdfs-nginx-module_v1.16.tar.gz - 3.libfastcommon-master.zip - 4.nginx-1.8.0.tar.gz
在使用CentOS7操作系统时,有时会遇到安装完成后无法联网的问题。这可能是由于网络配置不当导致的,解决这个问题的关键在于正确配置网络接口。以下是一份详细的步骤指南,帮助你解决CentOS7安装后无法联网的问题。 ...
linux企业实战运维入门到高级系列 ubuntu Centos ...自动化运维 安装kickstart文件(半自动化) ANSIBLE部署 企业级OpenVPN 安装OpenVPN 该笔记由刘森飚整理,版权归原作者所有 仅用于学习交流分享,如有争议请联系下架
win10mi版+Linux CentOS-7+苹果系统驱动加满的无敌合集
如果您的CentOS系统在安装时未取消"Base"选项,则krb5的相关包会默认安装。如果没有安装samba,可以通过以下命令进行安装: ```bash [root@filesrv CentOS]# rpm -ivh xinetd-2.3.14-10.el5.i386.rpm [root@filesrv...
真棒壳 精选的Shell框架,库和软件的精选清单。 :upside-down_face: 一个令人愉快的社区驱动的(拥有1700多个贡献者)框架,用于管理zsh配置。...适用于Ubuntu,Debian,CentOS和Fedora的OpenVPN R