拉取镜像
- docker pull kylemanna/openvpn:2.4
创建目录
- mkdir -p /data/openvpn
生成配置文件
docker run -v /data/openvpn:/etc/openvpn –rm kylemanna/openvpn:2.4 ovpn_genconfig -u udp://101.33.76.201
生成秘钥文件
docker run -v /data/openvpn:/etc/openvpn –rm -it kylemanna/openvpn:2.4 ovpn_initpki
输入私钥密码(输入时是看不见的):
Enter PEM pass phrase:12345678
再输入一遍
Verifying - Enter PEM pass phrase:12345678
输入一个CA名称(我这里直接回车)
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:
输入刚才设置的私钥密码(输入完成后会再让输入一次)
Enter pass phrase for /etc/openvpn/pki/private/ca.key:12345678
客户端证书
docker run -v /data/openvpn:/etc/openvpn –rm -it kylemanna/openvpn:2.4 easyrsa build-client-full TTSS nopass
输入刚才设置的密码
Enter pass phrase for /etc/openvpn/pki/private/ca.key:12345678
导出客户端配置
mkdir -p /data/openvpn/conf
docker run -v /data/openvpn:/etc/openvpn –rm kylemanna/openvpn:2.4 ovpn_getclient TTSS > /data/openvpn/conf/腾蛇.ovpn
启动open-vpn
docker run –name openvpn -v /data/openvpn:/etc/openvpn -d -p 1194:1194/udp –cap-add=NET_ADMIN kylemanna/openvpn:2.4
PS:
停止openvpn
docker stop openvpn
启动openvpn
docker start openvpn
docker restart openvpn
客户端证书目录
- /data/openvpn/conf
- link: http://example.com/2022/03/31/快速搭建open-vpn/
- Copyright notice: All articles on this website, unless otherwise stated, adopt CC BY-NC-ND 4.0 reprint policy. If reproduced, please indicate source!
你的赏识是我前进的动力
支付宝
微信
catalog
catalog