当前位置: 技术问答>linux和unix
openvpn服务器配置问题
来源: 互联网 发布时间:2016-10-04
本文导语: 我在linux进行openvpn配置时,server.conf文件出现了问题,我的server.conf文件如下: port 2194 proto udp dev tun server 10.9.0.0 255.255.255.0 push "route 172.18.2.0 255.255.255.0" push "dhcp-option DNS 172.18.2.23" push "dhcp-option DNS 202.96.128.86"...
我在linux进行openvpn配置时,server.conf文件出现了问题,我的server.conf文件如下:
port 2194
proto udp
dev tun
server 10.9.0.0 255.255.255.0
push "route 172.18.2.0 255.255.255.0"
push "dhcp-option DNS 172.18.2.23"
push "dhcp-option DNS 202.96.128.86"
ifconfig-pool-persist /usr/local/etc/ipp.txt
ca /usr/local/etc/keys/ca.crt
cert /usr/local/etc/keys/server.crt
key /usr/local/etc/keys/server.key
dh /usr/local/etc/keys/dh1024.pem
tls-auth /usr/local/etc/keys/ta.key 0
keepalive 10 120
comp-lzo
status /var/log/openvpn-status.log
verb 4
persist-key
persist-tun
可我在运行openvpn server.conf 时
总是提示Options error: Unrecognized option or missing parameter(s) in server.conf:4: server (2.0.9)
我检查半天server.conf文件都没发现错误,请教各位大牛。
port 2194
proto udp
dev tun
server 10.9.0.0 255.255.255.0
push "route 172.18.2.0 255.255.255.0"
push "dhcp-option DNS 172.18.2.23"
push "dhcp-option DNS 202.96.128.86"
ifconfig-pool-persist /usr/local/etc/ipp.txt
ca /usr/local/etc/keys/ca.crt
cert /usr/local/etc/keys/server.crt
key /usr/local/etc/keys/server.key
dh /usr/local/etc/keys/dh1024.pem
tls-auth /usr/local/etc/keys/ta.key 0
keepalive 10 120
comp-lzo
status /var/log/openvpn-status.log
verb 4
persist-key
persist-tun
可我在运行openvpn server.conf 时
总是提示Options error: Unrecognized option or missing parameter(s) in server.conf:4: server (2.0.9)
我检查半天server.conf文件都没发现错误,请教各位大牛。
|
ca /usr/local/etc/keys/ca.crt
cert /usr/local/etc/keys/server.crt
key /usr/local/etc/keys/server.key
dh /usr/local/etc/keys/dh1024.pem
放在server 10.9.0.0 255.255.255.0前试试
cert /usr/local/etc/keys/server.crt
key /usr/local/etc/keys/server.key
dh /usr/local/etc/keys/dh1024.pem
放在server 10.9.0.0 255.255.255.0前试试
|
port 1194
;proto tcp
proto udp
dev tap
;dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.8.0.0 255.255.0.0
ifconfig-pool-persist ipp.txt
;client-to-client
;duplicate-cn
keepalive 10 120
tls-auth ta.key 0
plugin ./openvpn-auth-pam.so openvpn
client-cert-not-required
username-as-common-name
comp-lzo
;max-clients 100
;user nobody
;group nobody
persist-key
persist-tun
status openvpn-status.log
log /etc/openvpn/openvpn.log
log-append openvpn.log
verb 4
;mute 20
tun-mtu 1472
tun-mtu-extra 32
mssfix 1400
client-connect /etc/openvpn/vpn
client-disconnect /etc/openvpn/vpnd
script-security 2
management localhost 7505
这个是我的配置文件!! 我是用用户名和密码来认证的
|
我同意这个看法 我自己遇到过
而且提示错误也很明显了 不能识别或者缺少参数
楼主你设置的时候 不要直接从网上复制 很可能是中文空格 中文字符 不可见字符的原因 或者dos格式的文件
自己要改什么手动在原来默认的文件里修改。