Loading
0

CentOS 7 安装OpenVPN

OpenVPN下载:

https://github.com/OpenVPN/openvpn/releases

EasyRSA下载:

https://github.com/OpenVPN/easy-rsa/releases

wget https://github.com/OpenVPN/openvpn/archive/v2.4.10.tar.gz

yum install -y lz4-devel lzo-devel pam-devel openssl-devel systemd-devel sqlite-devel
yum install -y autoconf
yum install -y automake
yum install -y libtool libtool-ltdl


autoreconf -i -v -f
./configure --prefix=/usr/local/openvpn --enable-lzo --enable-lz4 --enable-crypto --enable-server --enable-plugins --enable-port-share --enable-iproute2 --enable-pf --enable-plugin-auth-pam --enable-pam-dlopen --enable-systemd
make && make install
ln -s /usr/local/openvpn/sbin/openvpn /usr/local/sbin/openvpn


vim /usr/local/openvpn/lib/systemd/system/openvpn-server@.service
### 找到 ExecStart 这行,改为如下
ExecStart=/usr/local/openvpn/sbin/openvpn --config server.conf

cp -a /usr/local/openvpn/lib/systemd/system/openvpn-server@.service /usr/lib/systemd/system/openvpn.service
systemctl enable openvpn.service

使用EasyRSA生成证书:

wget https://github.com/OpenVPN/easy-rsa/archive/v3.0.7.tar.gz

参考:

最后编辑于:2021/4/13作者: 编程小战

我不入地狱,谁入地狱?

评论已关闭