关于网络手动搭建的一点补充说明
地址:
https://www.oschina.net/question/2005056_167372
https://www.xinruiyun.cn/zhishiku/4085.html
安装和生成文件说明
编译后的openvpn服务器,依赖了easyrsa。
服务端提示
一共需要六个文件:ca.crt crl.pem dh.pem server.crt server.key tls-auth.key
./easyrsa init-pki ./easyrsa build-ca nopass ./easyrsa gen-req server nopass ./easyrsa sign server server ./easyrsa gen-dh ./easyrsa gen-crl ./openvpn --genkey --secret tls-auth.key
其中五个文件的位置提示:
cp ../easy-rsa/pki/ca.crt . cp ../easy-rsa/pki/dh.pem . cp ../easy-rsa/pki/issued/server.crt . cp ../easy-rsa/pki/private/server.key . cp ../easy-rsa/pki/crl.pem .
客户端提示
生成文件两个 bai.key bai.crt
./easyrsa gen-req bai ./easyrsa sign client bai 或者: ./easyrsa build-client-full bai nopass
移动文件两个 ca.crt tls-auth.key,加上之前的两个,共四个文件
cp pki/issued/bai.crt pki/private/bai.key pki/ca.crt ../sbin/client/ cp server/tls-auth.key client/
服务端说明:
必须使用公有ip。在执行过脚本openvpn_install.sh上的脚本之后的测试结果通过。这里是ip是局部ip则去掉local xxx行。
修正后仿制usrG781服务端测试通过的代码:
port 1194 proto tcp dev tun #user nobody #group nogroup persist-key persist-tun keepalive 10 120 topology subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 1.1.1.1" push "dhcp-option DNS 1.0.0.1" crl-verify crl.pem ca ca.crt cert server.crt key server.key tls-auth tls-auth.key 0 dh dh.pem auth SHA256 cipher AES-256-CBC status openvpn-status.log verb 3 management localhost 7505
客户端说明:
这里添加的带有注释的一行,才能够识别到远程的主机remote。
client proto tcp-client remote xxxxxx 1194 dev tun resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert bai.crt key bai.key tls-auth tls-auth.key 1 auth SHA256 cipher AES-256-CBC setenv opt block-outside-dns # Prevent Windows 10 DNS leak verb 3
删除用户
./easyrsa revoke Name ./easyrsa gen-crl crl.pem覆盖到服务配置文件 重启openvpn
Le vent se lève! . . . il faut tenter de vivre!
Le vent se lève! . . . il faut tenter de vivre!

浙公网安备 33010602011771号