Skip to main content

阿里云 ECS linux下搭建openvpn服务器

 linux下搭建openvpn服务器

一、下载服务端安装脚本并获取权限

wget https://git.io/vpn -O openvpn-install.sh
chmod +x openvpn-install.sh
./openvpn-install.sh

输入自己的配置信息
ip:0.0.0.0
protocol:tcp
port:1194
DNS:current system resolvers
Client:客户端的名称(也是客户端文件名)

创建成功后 会在当前目录下生成一个客户端需要使用的ovpn后缀文件,用ftp工具获取到本地

二、本地配置

下载客户端windows版本
链接: 客户端下载地址
如果在本地无法下载 可以在服务器下载后再通过ftp的方式拉到本地

wget https://swupdate.openvpn.org/community/releases/openvpn-install-2.4.9-I601-Win10.exe

客户端安装和windows的软件基本一样,一直下一步就可以了。
安装完成后 桌面会自动创建一个Gui的启动器
安装好客户端后,将我们从服务器获取的文件放到客户端安装目录下的config目录下
开启Gui界面,在任务栏会多出一个类似网络连接的图标(如果没有可能在任务栏的隐藏界面或用管理员启动)
右键可以看到当前config目录下我们放置所有可以使用的客户端


选择任意链接 右键连接

5.png


停止服务

systemctl stop openvpn@-server

启动服务

systemctl start openvpn@-server


在服务端生成配置

./openvpn-install.sh  #Add a new client 选择此项就会在当前目录下生成 ovpn 配置文件


服务端配置地址

cd /etc/openvpn/server
vi server.conf


Linux整体比较简单


参考资料:

https://blog.csdn.net/chastera/article/details/108183207

Comments

Popular posts from this blog

Install Gradle on Windows

First, please make sure you have PowerShell installed on your Windows machine. And run the following commands: Set-ExecutionPolicy RemoteSigned -scope CurrentUser iex (new-object net.webclient).downloadstring('https://get.scoop.sh') scoop install gradle And then you can run   gradle --version if you see something like: Build time:   2017-04-10 13:37:25 UTC Revision:     b762622a185d59ce0cfc9cbc6ab5dd22469e18a6 Groovy:       2.4.10 Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015 JVM:          1.8.0_131 (Oracle Corporation 25.131-b11) OS:           Windows 10 10.0 amd64 This means the Gradle has been installed on your computer successfully.