VPN搭建 服务端和客户端,使用的是(OpenVPN)

首次发布:2024-06-20 14:20

服务端安装

有些系统默认没有安装wget则要安装wget,如果已安装这一步可以省掉

安装wget:

如果你使用的是基于Debian的系统(如Ubuntu),可以使用以下命令:

sudo apt-get update
sudo apt-get install wget

如果你使用的是基于Red Hat的系统(如CentOS),可以使用以下命令:

sudo yum update
sudo yum install wget


OpenVPN安装(我用的是Linux  Ubuntu 22系统,其它linux版本系统按照这样也可以),服务端安装流程如下

wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh

image.png

image.png

弹出选择框

Which services should be restarted?         │                                                                                
│                                             │                                                                                
│    [*] packagekit.service                   │                                                                                
│    [*] ssh.service                          │                                                                                
│    [*] systemd-journald.service             │                                                                                
│    [ ] systemd-logind.service               │                                                                                
│    [*] systemd-manager                      │                                                                                
│    [*] systemd-networkd.service             │                                                                                
│    [*] systemd-resolved.service             │                                                                                
│    [*] systemd-timesyncd.service            │                                                                                
│    [*] systemd-udevd.service                │                                                                                
│    [*] udisks2.service                      │                                                                                
│    [ ] user@0.service

我选择的是第一个 packagekit.service   

image.png


客户端安装(在这里我客户端用的系统是windows 10)

官方网下址地址 https://openvpn.net/community-downloads

因为官方网是国外的,如果打不开可以下载我上传的:链接: https://pan.baidu.com/s/1mN0CU-IhbWYKFC7Ko9ddjA?pwd=w9sm 

下载客户端安装好之后导入我们刚刚从服务器下拉的lqwvje.ovpn文件,导入之后,点连即可使用,流程如下

image.png

image.png


点上图连接之后,我们打开https://www.ip138.com/

image.png