![我在配置 openvpn 服务器并运行它时遇到问题](https://linux22.com/image/756896/%E6%88%91%E5%9C%A8%E9%85%8D%E7%BD%AE%20openvpn%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%B9%B6%E8%BF%90%E8%A1%8C%E5%AE%83%E6%97%B6%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98.png)
服务器日志
Options error: Unrecognized option or missing or extra parameter(s) in server.ovpn:4: cert (2.4.9) Use --help for more information.
服务器配置
server 192.168.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
ca ca.crt
cert serverport 1194
proto udp
有人能帮忙解决这个问题吗?
dev tun
server 192.168.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
ca ca.crt
cert serverVPN.crt
key serverVPN.key
dh dh1024.pem
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
client-to-client
log-append /var/log/openvpn
group daemon
daemon
verb 3.crt
key server.key
dh dh1024.pem
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
client-to-client
log-append /var/log/openvpn
group daemon
daemon
verb 3
答案1
问题恰恰出在错误消息中指定的行上。
cert serverport 1194
您需要使用指令提供证书的文件名cert
,并且serverport
指令应位于下一行。
答案2
正确的服务器配置是:
端口 1194 proto udp dev tun 服务器 192.168.1.0 255.255.255.0 ifconfig-pool-persist ipp.txt ca ca.crt cert serverVPN.crt 密钥 serverVPN.key dh dh1024.pem push “路由 192.168.1.0 255.255.255.0” push “重定向网关 def1” push “dhcp-option DNS 8.8.8.8” push “dhcp-option DNS 8.8.4.4” comp-lzo keepalive 10 60 ping-timer-rem persist-tun persist-key 客户端到客户端 log-append /var/log/openvpn 组守护进程守护进程动词 3.crt 密钥 server.key dh dh1024.pem push “路由 192.168.1.0 255.255.255.0”推送“redirect-gateway def1”推送“dhcp-option DNS 8.8.8.8”推送“dhcp-option DNS 8.8.4.4”comp-lzo keepalive 10 60 ping-timer-rem persist-tun persist-key 客户端到客户端 log-append /var/log/openvpn 组守护进程守护进程动词 3