tun0 doesn't show UP

Ask questions about your Access Server configuration here.
Post Reply
moelharrak
OpenVpn Newbie
Posts: 3
Joined: Tue Dec 19, 2017 3:49 pm

tun0 doesn't show UP

Post by moelharrak » Tue Dec 19, 2017 4:07 pm

Hi
I configured a VPN Server(VPS Ubuntu 16.04) using openvpn , however the interface tun doesn't show UP automatically , I need each time to run openvpn --config server.conf and not kill the session to make user authenticated.
this Is my configuration file
Server Configuration :
port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3

Configuration Client
client
dev tun
proto tcp
remote my-public-ip 1194
resolv-retry infinite
nobind
user nobody
group nobody
perssist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
comp-lzo
verb 3

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 4631
Joined: Fri Jun 03, 2016 1:17 pm

Re: tun0 doesn't show UP

Post by TinCanTech » Tue Dec 19, 2017 5:36 pm

moelharrak wrote:
Tue Dec 19, 2017 4:07 pm
the interface tun doesn't show UP automatically , I need each time to run openvpn --config server.conf and not kill the session
That is correct .. openvpn needs to be running in order to work.

moelharrak
OpenVpn Newbie
Posts: 3
Joined: Tue Dec 19, 2017 3:49 pm

Re: tun0 doesn't show UP

Post by moelharrak » Tue Dec 19, 2017 7:04 pm

That not correct , I have another vpn server installed in raspberry and the tun0 interface is always up even at the boot, and I don't need to run any command .
the "service openvpn status" command shows "Active" however "systemctl status openvpn@server" command shows the following error
openvpn@server.service - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-12-19 18:57:38 UTC; 5min ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/w ... n23ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 243 ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvp

Dec 19 18:57:38 vps45925 systemd[1]: Starting OpenVPN connection to server...
Dec 19 18:57:38 vps45925 ovpn-server[243]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PK
Dec 19 18:57:38 vps45925 ovpn-server[243]: library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Dec 19 18:57:38 vps45925 ovpn-server[243]: daemon() failed or unsupported: Resource temporarily unavailable (er
Dec 19 18:57:38 vps45925 ovpn-server[243]: Exiting due to fatal error
Dec 19 18:57:38 vps45925 systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Dec 19 18:57:38 vps45925 systemd[1]: Failed to start OpenVPN connection to server.
Dec 19 18:57:38 vps45925 systemd[1]: openvpn@server.service: Unit entered failed state.
Dec 19 18:57:38 vps45925 systemd[1]: openvpn@server.service: Failed with result 'exit-code'.

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 4631
Joined: Fri Jun 03, 2016 1:17 pm

Re: tun0 doesn't show UP

Post by TinCanTech » Wed Dec 20, 2017 3:04 pm

moelharrak wrote:
Tue Dec 19, 2017 7:04 pm
Dec 19 18:57:38 vps45925 ovpn-server[243]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PK
At least we now know this is not Access Server ... Also, please post output from $ openvpn --version
moelharrak wrote:
Tue Dec 19, 2017 7:04 pm
I have another vpn server installed in raspberry and the tun0 interface is always up even at the boot
Then you (or someone) must have configured that in networking .. outside of openvpn.
(Or you are mistaken :geek: )

Please see:
HOWTO: Request Help !

Server & client log files at --verb 4 please.

See --log & --verb in The Manual v24x

moelharrak
OpenVpn Newbie
Posts: 3
Joined: Tue Dec 19, 2017 3:49 pm

Re: tun0 doesn't show UP

Post by moelharrak » Wed Dec 20, 2017 5:24 pm

Hi thank you for your response
the openvpn --version shows
OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Originally developed by James Yonan
Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
Compile time defines: enable_crypto=yes enable_crypto_ofb_cfb=yes enable_debug=yes enable_def_auth=yes enable_dependency_tracking=no enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=yes enable_fragment=yes enable_http_proxy=yes enable_iproute2=yes enable_libtool_lock=yes enable_lzo=yes enable_lzo_stub=no enable_maintainer_mode=no enable_management=yes enable_multi=yes enable_multihome=yes enable_pam_dlopen=no enable_password_save=yes enable_pedantic=no enable_pf=yes enable_pkcs11=yes enable_plugin_auth_pam=yes enable_plugin_down_root=yes enable_plugins=yes enable_port_share=yes enable_selinux=no enable_server=yes enable_shared=yes enable_shared_with_static_runtimes=no enable_silent_rules=no enable_small=no enable_socks=yes enable_ssl=yes enable_static=yes enable_strict=no enable_strict_options=no enable_systemd=yes enable_win32_dll=yes enable_x509_alt_username=yes with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_plugindir='${prefix}/lib/openvpn' with_sysroot=no

- No I'm sure that I didn't configure that in networking and no one have access , it's get UP during installation and it's always UP at reboot

Post Reply