Page 1 of 1

How to make the client.ovpn file?

Posted: Sun Jun 10, 2018 7:06 pm
by Yashalta
Hi!
I have OpenVPN on the debian-server and Windows/Linux machines can easily connect to server without problems!
To me need also posibility to join android clients!
But, for connections from android need are client.ovpn file! What exactly client.ovpn must contain? And second question how to make the client.ovpn from what I have!
My server.conf

Code: Select all

dev tun
proto udp
port 1194

tls-server
server 10.11.0.0 255.255.255.0
comp-lzo

client-to-client
client-config-dir /etc/openvpn/ccd
ifconfig-pool-persist /etc/openvpn/ccd/ipp.txt   
dh /etc/openvpn/keys/dh1024.pem
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key

persist-tun
persist-key

tun-mtu 1500
tun-mtu-extra 32
mssfix 1450

push "ip route 10.11.0.0 255.255.255.0"

keepalive 10 120
ping-timer-rem
persist-tun
persist-key
user nobody
group users
daemon

log-append /var/log/openvpn/openvpn.log
status /var/log/openvpn/openvpn-status.log
verb 4
and my user.conf

Code: Select all

client
dev tun
proto udp  
remote XX.XX.XX.XX 1194  
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt       
cert user.crt   
key user.key  
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
ping-restart 60    
ping 10
tls-auth ta.key 1
cipher AES-256-CBC
ns-cert-type server
comp-lzo
log user.log
verb 3
sndbuf 0
rcvbuf 0

Re: How to make the client.ovpn file?

Posted: Sun Jun 10, 2018 7:39 pm
by bbuckm
It's easier to make the ovpn file on the server.

I haven't tried Android, but I did do iOS, and it's easier to embed the certificates rather than have separate files.

In other words, replace:

Code: Select all

ca ca.crt
with

Code: Select all

<ca>
-----BEGIN CERTIFICATE-----
MIIF...
-----END CERTIFICATE-----
</ca>
with corresponding changes elsewhere.

Re: How to make the client.ovpn file?

Posted: Tue Mar 31, 2020 2:29 pm
by code322
It is easier to make on the server and this script over on github makes it totally painless
https://github.com/Nyr/openvpn-install
It's called the Road Warrior for Debian, Ubuntu, CentOS