本文使用的服务器
- DigitalOcean, 1CPU,1G, 优惠
- CentOS 8.2
- OpenVPN 2.5.3
安装 OpenVPN
| 1 2 3 4 5 6 7 8 9 10 11 | #启用 openvpn 的库,这里有最新版本的包 dnf copr enable dsommers/openvpn-release #下载安装脚本 wget https://raw.githubusercontent | 
 
			
			
									
			
			
	Remi 主打 php 及相关扩展, 所以安装 php 这个库是不二选择.
首先进入 Remi 网站, 在 Maintained Enterprise Linux (RHEL / CentOS / Other clones) 列表中找到 Enterprise Linux 8 项后面的 remi-release-8.rpm , 执行下面的命令安装.
| 1 | dnf install http://rpms.remirepo | 
删除损坏的数据库文件
| 1 | rm -f /var/lib/rpm/__db* | 
清理 dnf 缓存
| 1 | dnf clean all | 
重建数据库
| 1 | rpm -vv --rebuilddb | 
重新更新
| 1 | dnf update | 
… 阅读全文
安装 dnf-automatic
| 1 | dnf install dnf-automatic | 
编辑配置文件
| 1 | nano /etc/dnf/automatic.conf | 
修改配置
| 1 | apply_updates = yes | 
保存退出
启动dnf计时器
以管理员身份运行CMD
| 1 2 3 4 5 | #从IE导入代理设置 netsh winhttp import proxy ie #独立设置代理 netsh winhttp set proxy 127.0.0.1:1088 "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*;<local>" | 
… 阅读全文
本文介绍使用 StrongSwan 搭建 VPN 的过程,适合有一定 linux 基础的用户。
StrongSwan 是基于 OpenSource IPsec 的 VPN 解决方案,官方网站:https://www.strongswan.org/ ,如果无法访问请使用科学上网,原因你懂的。
本文描述从一个初始系统开始逐步完成搭梯的过程。
以 root 用户登录
安装 epel 源
| 1 | dnf install epel-release | 
更新系统
| 1 | dnf update | 
安装必备软件
| 1 2 3 4 5 | dnf install nano wget nginx certbot iptables-services crontab #nginx开机启动 systemctl enable nginx #启动nginx systemctl restart nginx | 
StrongSwan IPsec IKEv2 连接需要用到服务器证书,用于验证服务器身份。由于自签发证书不受操作系统信任,我们需要申请 Let’s Encrypt 免费证书。
申请证书需要有域名,提前将域名解析到你的vps地址。