Comment #86 on issue 217624 by
dian...@chromium.org: Chrome OS OpenVPN
BTW: just because I was poking with this trying to get OpenVPN to work with
the OpenVPN server builtin to an RT-AC66U router. That router happens to
provide you an "ovpn" file and the instructions I found based on comment
@84 all assume an "onc" file. For me, it wasn't totally obvious how to
convert everything.
Here's extra stuff I needed:
---
Instructions I found all had the line:
openssl pkcs12 -export -in client.crt -inkey client.key -certfile ca.crt
-name MyClient -out client.p12
...but I didn't have a "client.crt", "client.key", and "ca.crt" file. I
had an "ovpn" file. Luckily these are easy to create text files.
* The "client.crt" is just all the stuff between "<cert>" and "</cert>" in
your ovpn file, including the "-----BEGIN CERTIFICATE-----" and "-----END
CERTIFICATE-----" but not including the "<cert>" and "</cert>".
* The "client.key" is the same, but the stuff between "<key>" and "</key>"
* If you couldn't guess, "ca.crt" is between "<ca>" and "</ca>".
I ran openssl on a Chromebook in dev mode, but presumably you could also
find it on various other Linux machines.
---
I needed to go to the Advanced Settings in the Asus Router to get things in
a way that matched all the config instructions I found. I also wanted the
VPN to go over TCP/443 to have the best chance of it make its way over
pesky networks. Overall I used these options on the Asus Router:
* Interface Type: TUN
* Protocol: TCP
* Server Port: 443 (AKA the https port)
* Firewall: Auto
* Authorization Mode: TLS
* Username / Password Auth. Only: No
* Extra HMAC authorization: Incoming (0)
* VPN Subnet / Netmask: 10.8.0.0 (255.255.255.0)
* Poll Interval: 0
* Push LAN to clients: yes
* Direct clients to redirect Internet traffic: yes
* Respond to DNS: yes
* Advertise DNS to clients: yes
* Encryption cipher: default
* Compression: adaptive
* TLS Renegotiation Time: -1
* Manage Client-Specific: no
I won't promise those are all ideal, but they did seem to work. Note that
until I chose "Extra HMAC authorization: Incoming (0)" the ovpn file that
was exported by the router (if you go back to "General") didn't contain
the "OpenVPN Static key" and that tripped me up for a while, since that
wasn't the default.
---
In the ".onc" file you might wonder about where you get the X509 cert.
Yeah, it really is the same one you used in making the .p12 file, but with
all the newlines stripped off and also with the "-----BEGIN
CERTIFICATE-----" and "-----END CERTIFICATE-----" removed.
I also made a few changes from what was generally suggested:
"CompLZO": "adaptive",
"Port": 443,
"Proto": "tcp",
...the port/protocol were because of my own choices. I don't know if the
CompLZO change was strictly necessary, but it matched the default server
config that Asus provided and seemed sane.
I also happened to get tripped up because some instructions I found online
provided a sample file and one of the quotes in there was a "smart" quote
and tripped up the import. Sigh.
---
Anyway, figured I'd add to this bug in case it was useful to anyone...
Maybe everything is terribly obvious to everyone but me. ;)