小记一下开启openvpn服务器#YouTube
创建证书
创建CA证书–选中key cert. sign、crl sign–sign选择主机IP
创建Server证书–选中digital signature、key encipherment、tls server–sign选择对应CA
创建Client证书–选中tls client–sign选择CA
把Server证书和Client证书(可不为trust)都设置trust。显示KIT状态正常。
导出CA证书文件名CA,导出Client证书,文件名Client,设置导出密钥。
网络设置
地址池—防火墙端口放行—snat–创建OVPN的profile—设置ovpn服务器端口、证书选择Server、默认策略
导出ovpn配置文件
选择对应CA、Client证书、key文件进行导出
openwrt对接
先安装openvpn的软件包,luci包等
加认证参数,一份用户账号密码auth,一份ovpn导出时的密钥
auth-user-pass /etc/openvpn/ovpn.auth
askpass /etc/openvpn/pass.txt
###修改配置文件,如下格式
root@OrangePi:~# cat /etc/openvpn/run.ovpn
client
dev tun
remote 123.123.123.123 443 tcp
tun-mtu 1500
tls-client
nobind
user nobody
group nogroup
ping 15
ping-restart 45
persist-tun
persist-key
mute-replay-warnings
verb 3
cipher AES-256-GCM
auth none
pull
auth-user-pass /etc/openvpn/run.auth
connect-retry 1
reneg-sec 3600
remote-cert-tls server
askpass /etc/openvpn/pass.txt
<ca>
-----BEGIN CERTIFICATE-----
****
-----END ENCRYPTED PRIVATE KEY-----
</key>
启动!