Page 1 of 1

Error starting openvpn service

Posted: Sat Mar 12, 2011 1:06 pm
by colinireland
Hello,

I have installed OpenVPN on my Centos VPS. When I start it using "service openvpn start" it fails.

[root@vps openvpn]# service openvpn start
Starting openvpn: [FAILED]


The logs show the following:

[root@vps openvpn]# tail /var/log/messages
Mar 12 07:33:47 vps openvpn[11537]: OpenVPN 2.0.9 x86_64-redhat-linux-gnu [SSL] [LZO] [EPOLL] built on Mar 12 2011
Mar 12 07:33:47 vps openvpn[11537]: IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Mar 12 07:33:47 vps openvpn[11537]: TUN/TAP device tun0 opened
Mar 12 07:33:47 vps openvpn[11537]: /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Mar 12 07:33:47 vps openvpn[11547]: GID set to nobody
Mar 12 07:33:47 vps openvpn[11547]: UDPv4 link local (bound): [undef]:1194
Mar 12 07:33:47 vps openvpn[11547]: UDPv4 link remote: [undef]
Mar 12 07:33:47 vps openvpn[11547]: Initialization Sequence Completed
Mar 12 07:33:47 vps openvpn[11549]: Options error: the --push directive should have at most 1 parameter. To pass a list of arguments as one of the parameters, try enclosing them in double quotes ("").
Mar 12 07:33:47 vps openvpn[11549]: Use --help for more information.

Is there a file I need to modify to put the parameters in to quotes?

Any help would be greatly appricated.

Regards,
Colin

Re: Error starting openvpn service

Posted: Sat Mar 12, 2011 7:47 pm
by Bebop
colinireland wrote:Is there a file I need to modify to put the parameters in to quotes
Yes. You will need to look at any/all .conf files in your /etc/openvpn directory. (or whatever your default install directory).

FYI: When you start openvpn as a service/daemon, openvpn loads each .conf file from /etc/openvpn, so you need to check that the syntax in each .conf file there is correct.

Re: Error starting openvpn service

Posted: Sat Mar 12, 2011 9:21 pm
by colinireland
Thanks for that Bebop. Worked like a charm.

I really didn't give the server.conf file enough attention

For anyone getting the same error ensure your server.conf file looks like this

push ".redirect-gateway def1."
push ".dhcp-option DNS 208.67.222.222."
push ".dhcp-option DNS 208.67.220.220."

Re: Error starting openvpn service

Posted: Mon Mar 14, 2011 4:10 am
by Bebop
colinireland wrote:

Code: Select all

push ".redirect-gateway def1."
push ".dhcp-option DNS 208.67.222.222."
push ".dhcp-option DNS 208.67.220.220."
Are the dots useful?

I always used:

Code: Select all

push "redirect-gateway def1"
push "dhcp-option DNS x.x.x.x"
push "dhcp-option DNS x.x.x.y"