linux部署openvpn的成功案例,以及解决无法ping通客户端

测试环境 虚拟机(即服务器)centos7(非linux9) 客户端:Windows 10 专业版 openvpn客户端版本:2.4.0 openvpn服务端: https://github.com/guoew/openvpn-install

请看https://www.fongdan.com/article/detail/21

服务端安装

a.下载openvpn: 将以上压缩包下载到服务器你喜欢的位置,解压,执行 bash openvpn-install.sh 命令

bash 复制代码
First, provide the IPv4 address of the network interface you want OpenVPN
listening to.
# 这一步直接回车

This server is behind NAT. What is the public IPv4 address or hostname?
Public IP address / hostname:
# 这一步要输入你的公网ip

Which protocol do you want for OpenVPN connections?
   1) UDP (recommended)
   2) TCP
Protocol [1-2]:
#这一步看你自己选择,默认1也可以

What port do you want OpenVPN listening to?
Port: 1194
#这一步是服务端口,看自己需求可以修改

Which DNS do you want to use with the VPN?
#这一步选dns,默认1就好

Finally, tell me your name for the client certificate.
Please, use one word only, no special characters.
Client name: client
#这一步创建客户端连接配置文件,输入文件名,默认client就好

# ...
Your client configuration is available at: /xxx/xxx/client.ovpn #客户端配置文件路径(一般是在/etc/openvpn/,看这里提示是什么就去哪里找)

最后看到有Finished!字样,说明安装完成

b.配置客户端账号密码 在openvpn安装目录下,有userfile.sh文件,里面可以添加客户端账号密码,格式如下:

bash 复制代码
ashdui 123iojsa
ioeur 343234098

c.查看openvpn是否正确安装,正确运行

bash 复制代码
systemctl status openvpn-server@server.service

确认无误,即完成安装

再次执行bash openvpn-install.sh 会有四个菜单选项(添加、撤销、卸载、退出),可根据自身实际情况应用,如下:

bash 复制代码
Looks like OpenVPN is already installed.

What do you want to do?
   1) Add a new user
   2) Revoke an existing user
   3) Remove OpenVPN
   4) Exit
Select an option [1-4]:

客户端安装

a.将上面生成的 client.ovpn 文件下载

b.下载安装openvpn.exe文件;安装过程会提示安装虚拟网卡,点允许,需要什么权限也要点允许;

详情请看https://www.fongdan.com/article/detail/21

相关推荐
雨大王5121 小时前
汽车生产智能计划助手如何提升排产效率并降低库存积压?
大数据·运维
嵌入小生0071 小时前
线程(2)/ 线程属性 /相关函数接口--- 嵌入式(Linux)
linux·嵌入式·线程·软件编程·僵尸线程·马年开工第一学·线程属性
以太浮标2 小时前
华为eNSP综合实验之- 3a认证配置案例及解析(AAA认证)
运维·tcp/ip·网络安全·华为·信息与通信
No8g攻城狮2 小时前
【Linux】Linux nano 编辑器全攻略:从入门到精通
linux·运维·编辑器·nano
zl_dfq2 小时前
Linux 之 【网络套接字编程】(固定宽度整数类型、socket常见API、netstat)
linux·网络
2301_805962933 小时前
arduino IDE如何设置代理
运维·服务器
shughui4 小时前
Docker Desktop下载、安装、配置、使用
运维·docker·容器·自动化
huaweichenai4 小时前
Linux安装http-server并部署html静态站点
linux·运维·服务器
Gss7775 小时前
Linux 正则表达式详解(基础 + 扩展 + 实操)
linux·运维·正则表达式
北冥湖畔的燕雀5 小时前
Linux权限与Vim,gcc以及make/makefile操作全解析
linux·运维·服务器