Page 1 of 1

openvpn start with exit ubuntu 20

Posted: Tue Nov 08, 2022 8:26 am
by scorpoin
Greetings,

I have just setup openvpn on ubunut-20 it does not give any error or such when starting service

Code: Select all

#Server_Configuration
#=================
#File-Configuration
port 8800
proto udp
dev tun
ca    /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/server.crt
key /etc/openvpn/server/server.key
##dh /etc/openvpn/dh.pem # We are using ec algorithm so we do not need DH
dh none
server 10.10.10.0 255.255.255.0
mode server
push "redirect-gateway def1"
push "dhcp-option DNS 208.67.220.220"
push "dhcp-option DNS 208.67.222.222"
#push "dhcp-option DNS 8.8.4.4"
#push "dhcp-option DNS 8.8.8.8"
client-config-dir /etc/openvpn/ccd # for fixed ip assigning for client
ifconfig-pool-persist /etc/openvpn/ipp.txt #log previous ip of cliemt
##tls-auth ta.key 0 # This file is secret
tls-crypt ta.key
auth SHA256
key-direction 0
##cipher AES-256-CBC
cipher AES-256-GCM
client-to-client # if you would like connecting clients to be able to reach each other over the VPN
#duplicate-cn # disble it if we are using one config for one client
keepalive 10 120
comp-lzo no
compress
user nobody
#group nobody # old_version_ubuntu
group nogroup #latest version ubuntu
persist-key
persist-tun
crl-verify crl.pem # Latested_ubuntu_version
explicit-exit-notify 1# if using UDP protocol
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
verb 4
mute 20

Code: Select all

#Base_config_Client
#===============
client
dev tun
proto udp
remote <WAN_IP> 8800 #This is serve IP
resolv-retry infinite
nobind
persist-key
persist-tun
cipher cipher AES-256-GCM
auth SHA256
remote-cert-tls server
key-direction 1
#comp-lzo
comp-lzo no
compress
auth-nocache
verb 3

Code: Select all

systemctl status openvpn.service 
● openvpn.service - OpenVPN service
     Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2022-11-08 08:18:20 UTC; 3min 56s ago
    Process: 67581 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 67581 (code=exited, status=0/SUCCESS)

Nov 08 08:18:20 ubuntu-2gb-ash-1 systemd[1]: Starting OpenVPN service...
Nov 08 08:18:20 ubuntu-2gb-ash-1 systemd[1]: Finished OpenVPN service.
Even when I run ifconfig -a tun0 device does not list .

Code: Select all

netstat -aupn | grep 8800
shows nothing it seems like service is not running .

Any idea what could be the issue?

Regards

Re: openvpn start with exit ubuntu 20

Posted: Tue Nov 08, 2022 9:25 am
by ordex
I presume this is happening on the server, right? can you check /var/log/openvpn.log ?

Re: openvpn start with exit ubuntu 20

Posted: Tue Nov 08, 2022 9:55 am
by scorpoin
ordex wrote:
Tue Nov 08, 2022 9:25 am
I presume this is happening on the server, right? can you check /var/log/openvpn.log ?
Strange thing is there is nothing in /var/log/openvpn folder . I could not figure out what I have missed?

Re: openvpn start with exit ubuntu 20

Posted: Tue Nov 08, 2022 10:02 am
by ordex
I was talking about the log file that you have specified in the server config

Code: Select all

log /var/log/openvpn.log

Re: openvpn start with exit ubuntu 20

Posted: Tue Nov 08, 2022 10:48 am
by scorpoin
ordex wrote:
Tue Nov 08, 2022 10:02 am
I was talking about the log file that you have specified in the server config

Code: Select all

log /var/log/openvpn.log
There is no such file on path /var/log/openvpn.log

I have updated the path there is folderin /var/log/openvpn but no logs there :( .

Re: openvpn start with exit ubuntu 20

Posted: Tue Nov 08, 2022 6:46 pm
by Pippin