Addison12
By:
Addison12

Error with setting up OpenVPN Client files?

May 2, 2016 4.1k views
DigitalOcean VPN

I have been trying to set up multiple OpenVPN Client files for use on multiple computers.

The guide I am following is : https://www.digitalocean.com/community/tutorials/how-to-setup-and-configure-an-openvpn-server-on-centos-7

One of the instructions while setting up is as follows:

Make sure that if you do this you give them descriptive names, but for now we're going to have one client so we'll just call it client.

cd /etc/openvpn/easy-rsa ./build-key client

As such, I simply ran the buildkey with different client names (client00,client01 etc.).

The config file I have modified as such:

client00
dev tun
proto udp
remote x.x.x.x 1194
resolv-retry infinite
nobind
persist-key
persist-tun
comp-lzo
verb 3
<ca>
-----BEGIN CERTIFICATE-----
MIIFDzCCA/egAwIBAgIJAKVmRtQlSKGkMA0GCSqGSIb3DQEBCwUAMIG1MQswCQYD
VQQGEwJVUzELMAkGA1UECBMCQ0ExFTATBgNVBAcTDFNhbkZyYW5jaXNjbzEVMBMG
A1UEChMMRm9ydC1GdW5zdG9uMR0wGwYDVQQLExRNeU9yZ2FuaXphdGlvbmFsVW5p
dDEYMBYGA1UEAxMPYW1iZXJzZW1iZXIuY29tMQ8wDQYDVQQpEwZzZXJ2ZXIxITAf
BgkqhkiG9w0BCQEWEm1lQG15aG9zdC5teWRvbWFpbjAeFw0xNjA1MDExMDE3MjRa
Fw0yNjA0MjkxMDE3MjRaMIG1MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFTAT
BgNVBAcTDFNhbkZyYW5jaXNjbzEVMBMGA1UEChMMRm9ydC1GdW5zdG9uMR0wGwYD
VQQLExRNeU9yZ2FuaXphdGlvbmFsVW5pdDEYMBYGA1UEAxMPYW1iZXJzZW1iZXIu
Y29tMQ8wDQYDVQQpEwZzZXJ2ZXIxITAfBgkqhkiG9w0BCQEWEm1lQG15aG9zdC5t
eWRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOgGlOhe4viT
d/D0+Ruj3wB8j/pZ122VETwmY5HpmbDKfwiugbla0rYadVwtTS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Ofk1MDqdY9Zl+5PM8NtzvluQJ/q0nIUyMqWr0kOpfDEwRJGSu1s+6h3Q51rMBTNP
hVY5/rsvoPKqMZ3ECDF/TLb1a6cwJHt84gX5ONTwERlg5qGBE/4vxyAGc8+V/zaj
yZMXCMpGaP+JMuin+KChAkWOeNjJTgFN4SyV7IspAoGBAMT6Vjy0HZwlXEk4n+jK
mD6gyPQqsenBUQLBc83oc4dQV2w3o0e4rkpk3LDm6v+OdIOj8OXTqo6hMNbIlwzW
/zC9lDvcvQknvpWgMRDECA+pQts/NLgoVgz24LrdchCS+uzgyHM3SwI6fRn0r5yN
vBHHGU0F/q3Y2wzYqnihXwqb
-----END PRIVATE KEY-----
</key>

However the GUI gets stuck on connecting.

I ran the CMD

Options error: Unrecognized option or missing parameter(s) in
client00.ovpn:1: client00 (2.3.10)

What am i doing wrong?

1 comment
  • The very first line in your configuration file needs to be removed.
    You can name the file client00 if you want, but it can't go in the config file itself.

    On a side note and a precaution, it would be best not to post your private key out in the public like you just did.

    I would ditch this particular certificate and generate a new one (keys are meant to be private/secret).

2 Answers

There are two things you've done wrong - the first is to post a complete configuration for your server! You've taken out your IP address, but your domain name can still be pulled out of those certificates. I'd change those immediately, if I were you.

But in the configuration, "client" at the beginning is not the client name, it indicates that the .ovpn file is a client configuration, and not a server one. The actual client name is encoded in one of the certificates.

:)) how did you manage to paste the whole certificates?

Anyway, I have almost the same problem, except the fact that my error is in other file.
Error log:
Thu Oct 12 02:18:58 2017 usernameafk/73...*:48664 Options error: Unrecognized option or missing or extra parameter(s) in clients/usernameafk:1: username_afk (2.4.0)

I've assigned a specific IP addresses to specific clients, I use the subdirectory "clients" for client-specific configuration files.
The error appears in a client-specific configuration file, first line.

[root@hosted log]# cat /etc/openvpn/clients/usernameafk
username
afk
ifconfig-push 10.127.0.5 255.255.0.0
[root@hosted log]#

My problem is: If I remove this first line (containing the username) the error in the log dissapears, but client is not assigned with a desired IP address.

How can I deal with this one, does anyone know?

Have another answer? Share your knowledge.