Debian 9 - Tunnel Interface Not Found - New Install

This forum is for all inquiries relating to the installation of OpenVPN from source and with binaries.
Forum rules
Please visit (and READ) the OpenVPN HowTo http://openvpn.net/howto prior to asking any questions in here!
xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Thu Dec 28, 2017 5:04 pm

I have installed Openvpn (2.4.0-6+deb9u1) on Debian 9.3

I have set up of the config file as follows:

server.conf
#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine <-> single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
# #
# Comments are preceded with '#' or ';' #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one. You will need to
# open up this port on your firewall.
# 2-wire port forward - UDP 28469 1194 600
port 1194

# TCP or UDP server?
proto tcp
;proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one. On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key). Each client
# and the server must have their own cert and
# key file. The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys. Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).

ca "/etc/openvpn/server/ca.crt"
cert "/etc/openvpn/server/server.crt"
key "/etc/openvpn/server/server.key"

# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
dh "/etc/openvpn/server/dh2048.pem"


# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0
;server 10.8.0.1 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file. If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist "/etc/openvpn/server/ipp.txt"
;--ifconfig-pool start-IP end-IP [netmask]
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 172.x.x.200 255.255.255.0 172.x.x.40 172.x.x.45

;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100


# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses. You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
push "route 172.x.x.0 255.255.255.0"
;

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
# iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN. This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
# ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients. There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
# group, and firewall the TUN/TAP interface
# for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
# modify the firewall in response to access
# from different clients. See man
# page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
#;push "dhcp-option DNS 208.67.222.222"
#;push "dhcp-option DNS 208.67.220.220"
push "dhcp-option DNS 172.x,x.30"
push "dhcp-option DNS 172.x.x.20"
# push 2-wire gateway as default DNS
# ;push "dhcp-option DNS 172.x.x.200"
# ;push server as WINS server
push "dhcp-option WINS 10.8.0.1"
# ;push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DOMAIN xxx.LOCAL"
push "dhcp-option DOMAIN xxxyyy.LOCAL"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
# openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
user nobody
group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status "/var/log/openvpn-status.log"

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it. Use one
# or the other (but not both).
log openvpn.log
log-append /var/log/openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 4

# Silence repeating messages. At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20

# management localhost 7505
crl-verify "/etc/openvpn/server/crl.pem"


The issue is that the tunnel interface is not found by OpenVPN:

Dmesg

Code: Select all

[865552.760330] tun: Unknown symbol dev_get_valid_name (err 0)

The device is present:
  • tunnel device

    Code: Select all

    # ls -l /dev/net/tun
    crw-rw-rw- 1 root root 10, 200 Dec 18 10:03 /dev/net/tun
The tun device does not show up under ifconfig -a:

Code: Select all

# ifconfig -a
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.x.x.30  netmask 255.255.255.0  broadcast 172.x.x.255
        inet6 fe80::21e:4fff:fe15:e85f  prefixlen 64  scopeid 0x20<link>
        ether 00:1e:4f:15:e8:5f  txqueuelen 1000  (Ethernet)
        RX packets 1157059691  bytes 1708776148564 (1.5 TiB)
        RX errors 0  dropped 6  overruns 0  frame 0
        TX packets 137553384  bytes 53435735383 (49.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:1e:4f:15:e8:61  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 122449  bytes 21444841 (20.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 122449  bytes 21444841 (20.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
systemd log

Code: Select all

Dec 28 10:52:03 nis-1 systemd[1]: Starting OpenVPN service...
Dec 28 10:52:03 nis-1 systemd[1]: Starting OpenVPN connection to server...
Dec 28 10:52:03 nis-1 systemd[1]: Started OpenVPN service.
Dec 28 10:52:03 nis-1 systemd[1]: Started OpenVPN connection to server.
Dec 28 10:52:03 nis-1 kernel: [866896.095767] tun: Unknown symbol dev_get_valid_name (err 0)
Dec 28 10:52:03 nis-1 systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Dec 28 10:52:03 nis-1 systemd[1]: openvpn@server.service: Unit entered failed state.
Dec 28 10:52:03 nis-1 systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Been battling for several hours - any guidance appreciated!!
Last edited by xq1xq1xq1 on Thu Dec 28, 2017 7:09 pm, edited 1 time in total.

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Thu Dec 28, 2017 6:04 pm

On Spec I rebooted now it looks like Network Manager is getting in the way:

systemd log

Code: Select all

Dec 28 11:56:38 nis-1 systemd[1]: Starting OpenVPN service...
-- Subject: Unit openvpn.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn.service has begun starting up.
Dec 28 11:56:38 nis-1 systemd[1]: Starting OpenVPN connection to server...
-- Subject: Unit openvpn@server.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn@server.service has begun starting up.
Dec 28 11:56:38 nis-1 systemd[1]: Started OpenVPN service.
-- Subject: Unit openvpn.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn.service has finished starting up.
--
-- The start-up result is done.
Dec 28 11:56:38 nis-1 systemd[1]: Started OpenVPN connection to server.
-- Subject: Unit openvpn@server.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn@server.service has finished starting up.
--
-- The start-up result is done.
Dec 28 11:56:38 nis-1 NetworkManager[4969]: <info>  [1514483798.6986] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/4)
Dec 28 11:56:38 nis-1 named[1121]: 28-Dec-2017 11:56:38.701 network: info: listening on IPv4 interface tun0, 10.8.0.1#53
Dec 28 11:56:38 nis-1 NetworkManager[4969]: <info>  [1514483798.7065] devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec 28 11:56:38 nis-1 NetworkManager[4969]: <info>  [1514483798.7065] device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Dec 28 11:56:38 nis-1 named[1121]: 28-Dec-2017 11:56:38.707 network: info: no longer listening on 10.8.0.1#53
Dec 28 11:56:38 nis-1 gnome-shell[1781]: JS LOG: Removing a network device that was not added
Dec 28 11:56:38 nis-1 NetworkManager[4969]: <info>  [1514483798.7142] devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec 28 11:56:38 nis-1 systemd[1]: openvpn@server.service: Main process exited, code=exited, status=1/FAILURE
Dec 28 11:56:38 nis-1 systemd[1]: openvpn@server.service: Unit entered failed state.
Dec 28 11:56:38 nis-1 systemd[1]: openvpn@server.service: Failed with result 'exit-code'.

dazo
OpenVPN Inc.
Posts: 136
Joined: Mon Jan 11, 2010 10:14 am
Location: dazo :: #openvpn-devel @ irc.freenode.net

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by dazo » Thu Dec 28, 2017 7:11 pm

Please read this systemd README file: https://github.com/OpenVPN/openvpn/blob ... ME.systemd

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Thu Dec 28, 2017 9:59 pm

Thanx so much for pointing out the readme come - I reread it and I might be dense but I don't see anything in the readme with respect to networkmanager removing the tunnel interface due to a lack of ifupdown configuration.

I installed openvpn on a centos box a few years back with not so much as I hiccup - I'm getting very frustrated by Debian and the off the wall issues that I'm having.

Enlightenment is most welcome.

dazo
OpenVPN Inc.
Posts: 136
Joined: Mon Jan 11, 2010 10:14 am
Location: dazo :: #openvpn-devel @ irc.freenode.net

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by dazo » Thu Dec 28, 2017 11:35 pm

You seem to be using some Debian whacked systemd unit files for OpenVPN. Those are known to cause odd issues. Trying to make things behave like the "old pre-systemd days" on a systemd based install is never going to be fully functional. And for OpenVPN, it more often causes issues than solves them. So switching to openvpn-{client,server}@CONFIGNAME unit files might be somewhat better. And it is the only unit files the community can fully support as those are what we provide. The crappy openvpn systemd unit files (openvpn.service and openvpn@.service) which ships with Debian is provided by Debian only, and can only be supported by Debian.

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Thu Dec 28, 2017 11:40 pm

Okay - that makes sense

Always looking for better implementations :-) and have been very frustrated by Debian in a lot of ways but it's what I have :-(

Where can I find the openvpn community supported unit files so that I can modify for my Installation?

dazo
OpenVPN Inc.
Posts: 136
Joined: Mon Jan 11, 2010 10:14 am
Location: dazo :: #openvpn-devel @ irc.freenode.net

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by dazo » Thu Dec 28, 2017 11:50 pm

If you have openvpn-2.4.4, you should hopefully have the latest and greatest. But you can also download the openvpn-{client,server}@.service.in from here: https://github.com/OpenVPN/openvpn/tree ... ro/systemd. Rename them to openvpn-{client,server}@.service and put them in /etc/systemd/system and replace @sbindir@ to wherever your openvpn binary is (most likely /usr/sbin).

You might also want to download tmpfiles-openvpn.conf, rename it to openvpn.conf and put it into /etc/tmpfiles.d/.

Once that's done run:
systemctl daemon-reload
systemd-tmpfiles --create /etc/tmpfiles.d/openvpn.conf

Now your system should be able to use the latest and greatest.

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Fri Dec 29, 2017 12:31 am

You've been extremely helpful.

I will work on this tomorrow and report back results.

Thanx again!

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Fri Dec 29, 2017 8:32 pm

I have made some progress with the excellent guidance above but still I am having issues getting the tunnel to stay up

systemctl command

Code: Select all

systemctl start openvpn-server@server.service

This now seems to make it farther to getting started:

journalctl -xe

Code: Select all

Dec 29 09:37:39 nis-1 systemd[1]: Starting OpenVPN service for server...
-- Subject: Unit openvpn-server@server.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn-server@server.service has begun starting up.
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <info>  [1514561859.3545] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/6)
Dec 29 09:37:39 nis-1 named[1121]: 29-Dec-2017 09:37:39.358 network: info: listening on IPv4 interface tun0, 10.8.0.1#53
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <info>  [1514561859.3629] devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <info>  [1514561859.3630] device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <info>  [1514561859.3631] device (tun0): state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]
Dec 29 09:37:39 nis-1 named[1121]: 29-Dec-2017 09:37:39.363 network: info: no longer listening on 10.8.0.1#53
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <warn>  [1514561859.3684] device (tun0): failed to get TUN interface info while updating connection.
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <info>  [1514561859.3688] device (tun0): state change: unavailable -> unmanaged (reason 'unmanaged') [20 10 3]
Dec 29 09:37:39 nis-1 NetworkManager[3739]: <info>  [1514561859.3694] devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec 29 09:37:39 nis-1 gnome-shell[1781]: JS LOG: Removing a network device that was not added
Dec 29 09:37:39 nis-1 systemd[1]: openvpn-server@server.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 09:37:39 nis-1 systemd[1]: Failed to start OpenVPN service for server.
-- Subject: Unit openvpn-server@server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn-server@server.service has failed.
--
-- The result is failed.
Dec 29 09:37:39 nis-1 systemd[1]: openvpn-server@server.service: Unit entered failed state.
Dec 29 09:37:39 nis-1 systemd[1]: openvpn-server@server.service: Failed with result 'exit-code'.
The issue still seems to point to Network Manger:

NetworkManager.conf

Code: Select all

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

etc_network_interfaces

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
auto tun
iface tun inet manual
    openvpn tun

It seems to be something with NetworkManager but not sure how to stop it from being taken down after it comes up.

Thoughts?

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Fri Dec 29, 2017 9:15 pm

I did a manual compile of 2016.12.16 -- Version 2.4_rc2

This is my /etc/systemd/system/openvpn-server@.service file

Code: Select all

[Unit]
Description=OpenVPN service for %I
After=syslog.target network-online.target
Wants=network-online.target
Documentation=man:openvpn(8)
Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO

[Service]
Type=notify
PrivateTmp=true
WorkingDirectory=/etc/openvpn/server
ExecStart=/usr/local/sbin/openvpn --status %t/openvpn-server/status-%i.log --status-version 2 --suppress-timestamps --config %i.conf
CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE
LimitNPROC=10
DeviceAllow=/dev/null rw
DeviceAllow=/dev/net/tun rw
ProtectSystem=true
ProtectHome=true
KillMode=process
RestartSec=5s
Restart=on-failure

[Install]
WantedBy=multi-user.target
After running systemctl start openvpn@server.conf this is my journalctl -xe output:

journalctl_-xe

Code: Select all

-- Support: https://www.debian.org/support
--
-- Unit openvpn-server@server.service has failed.
--
-- The result is failed.
Dec 29 15:10:30 nis-1 systemd[1]: openvpn-server@server.service: Unit entered failed state.
Dec 29 15:10:30 nis-1 systemd[1]: openvpn-server@server.service: Failed with result 'exit-code'.
Dec 29 15:10:35 nis-1 named[1112]: 29-Dec-2017 15:10:35.197 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
Dec 29 15:10:35 nis-1 named[1112]: 29-Dec-2017 15:10:35.197 lame-servers: info: no valid RRSIG resolving 'microsoft.com/DS/IN': 208.67.222.222#53
Dec 29 15:10:35 nis-1 named[1112]: 29-Dec-2017 15:10:35.272 dnssec: info:   validating com/SOA: got insecure response; parent indicates it should be secure
Dec 29 15:10:35 nis-1 named[1112]: 29-Dec-2017 15:10:35.273 lame-servers: info: no valid RRSIG resolving 'microsoft.com/DS/IN': 208.67.220.220#53
Dec 29 15:10:35 nis-1 systemd[1]: openvpn-server@server.service: Service hold-off time over, scheduling restart.
Dec 29 15:10:35 nis-1 systemd[1]: Stopped OpenVPN service for server.
-- Subject: Unit openvpn-server@server.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn-server@server.service has finished shutting down.
Dec 29 15:10:35 nis-1 systemd[1]: Starting OpenVPN service for server...
-- Subject: Unit openvpn-server@server.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn-server@server.service has begun starting up.
Dec 29 15:10:35 nis-1 named[1112]: 29-Dec-2017 15:10:35.695 network: info: listening on IPv4 interface tun0, 10.8.0.1#53
Dec 29 15:10:35 nis-1 NetworkManager[1038]: <info>  [1514581835.6955] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/67)
Dec 29 15:10:35 nis-1 named[1112]: 29-Dec-2017 15:10:35.702 network: info: no longer listening on 10.8.0.1#53
Dec 29 15:10:35 nis-1 gnome-shell[1696]: JS LOG: Removing a network device that was not added
Dec 29 15:10:35 nis-1 NetworkManager[1038]: <info>  [1514581835.7074] devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec 29 15:10:35 nis-1 NetworkManager[1038]: <info>  [1514581835.7074] device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Dec 29 15:10:35 nis-1 NetworkManager[1038]: <info>  [1514581835.7109] devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec 29 15:10:35 nis-1 systemd[1]: openvpn-server@server.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 15:10:35 nis-1 systemd[1]: Failed to start OpenVPN service for server.
-- Subject: Unit openvpn-server@server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit openvpn-server@server.service has failed.
--
-- The result is failed.
Dec 29 15:10:35 nis-1 systemd[1]: openvpn-server@server.service: Unit entered failed state.
Dec 29 15:10:35 nis-1 systemd[1]: openvpn-server@server.service: Failed with result 'exit-code'.

I am getting the same NetworkManager no ifupdown error as I got with the prebuilt debian 2.4.0-6+deb9u1 package.

This is looking more and more like something that I need to tweak in NetworkManager for the tunnel to keep it up.

Thoughts?

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

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by TinCanTech » Sat Dec 30, 2017 1:40 am

Please can you edit your posts to use the correct BBCode

eg: BBCode is [ code ]

Code: Select all

code and logfiles
goes here
This is easier to read code and logfiles.

eg: BBCode is [ oconf="Server or client config" ]
OPENVPN server or client config
server or client config
#this is hidden by oconf
goes here
Press [ View Original ] to see why.

Edited for clarity by Forum Mod to use "code" where approriate.
Last edited by TinCanTech on Sat Dec 30, 2017 2:50 pm, edited 1 time in total.

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Sat Dec 30, 2017 12:22 pm

Sorry bout that - I mistakenly assumed that the oconf button at the top of the editor was the correct bbcode

I assume it’s the same format-ie

Code: Select all

yyyyy
If this syntax is incorrect let me know as I am new to this.

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

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by TinCanTech » Thu Jan 04, 2018 11:09 pm

I guess you cannot edit your posts any longer .. please use the right BBCode in future.

So, how did you get on .. any success ?

I note you have this:
xq1xq1xq1 wrote:
Fri Dec 29, 2017 8:32 pm

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
auto tun
iface tun inet manual
    openvpn tun
Why are you trying to define tun ?

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Fri Jan 05, 2018 5:42 pm

From the error message I thought maybe that the tun configuration would resolve the issue - it didn’t help though- I will remove this configuration

Still stuck with the same error and have had no success as of now and I’m looking at alternatives now

I don’t know what to try next

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

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by TinCanTech » Fri Jan 05, 2018 8:10 pm

TinCanTech wrote:
Thu Jan 04, 2018 11:09 pm
I guess you cannot edit your posts any longer .. please use the right BBCode in future.

So, how did you get on .. any success ?

I note you have this:
xq1xq1xq1 wrote:
Fri Dec 29, 2017 8:32 pm

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
auto tun
iface tun inet manual
    openvpn tun
Why are you trying to define tun ?
Get rid of that tun stuff

Then simply start openvpn like so:

Code: Select all

$ sudo -s
# cd /etc/openvpn
# openvpn file-name.conf

TiTex
OpenVPN Expert
Posts: 271
Joined: Tue Apr 12, 2011 6:22 am

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by TiTex » Sat Jan 06, 2018 8:20 am

I've read somewhere that if you run your server in some cloud provider like digitalocean ... there might be a mismatch between the kernel version that you're running and the tun kernel module that you try to load.
see here http://forums.debian.net/viewtopic.php?f=5&t=126172 and here https://bugs.debian.org/cgi-bin/bugrepo ... bug=884569

xq1xq1xq1
OpenVPN User
Posts: 10
Joined: Thu Dec 28, 2017 4:36 pm

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by xq1xq1xq1 » Sat Jan 06, 2018 4:48 pm

TinCanTech:

I had removed the tun config earlier on spec with no success, this is my current config:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

When I try to run OpenVpn manually with the config file I get nothing returned on my screen but get the same logs as before:

Code: Select all


openvpn --config server/server.conf

Jan  6 10:42:04 nis-1 NetworkManager[1038]: <info>  [1515256924.0846] manager: (tun0): new Tun device (/org/freedesktop/NetworkManager/Devices/128386)
Jan  6 10:42:04 nis-1 named[4706]: 06-Jan-2018 10:42:04.089 network: info: listening on IPv4 interface tun0, 10.8.0.1#53
Jan  6 10:42:04 nis-1 named[4706]: 06-Jan-2018 10:42:04.094 network: info: no longer listening on 10.8.0.1#53
Jan  6 10:42:04 nis-1 NetworkManager[1038]: <info>  [1515256924.0985] devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Jan  6 10:42:04 nis-1 NetworkManager[1038]: <info>  [1515256924.0986] device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Jan  6 10:42:04 nis-1 NetworkManager[1038]: <info>  [1515256924.1025] devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)

TiTex:

I am working on a local server - there is no cloud provider involved so I do not think there is anything for me to do on that is there?

Thanx everyone for offering suggestion :-)

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

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by TinCanTech » Sat Jan 06, 2018 5:18 pm

Stop using Network-Manager.

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

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by TinCanTech » Wed Jan 10, 2018 4:22 pm

In an effort to get to the bottom of this, did you try without using network-manager ?
Because it is difficult to tell if the problem is with openvpn or network-manager.

dazo
OpenVPN Inc.
Posts: 136
Joined: Mon Jan 11, 2010 10:14 am
Location: dazo :: #openvpn-devel @ irc.freenode.net

Re: Debian 9 - Tunnel Interface Not Found - New Install

Post by dazo » Wed Jan 10, 2018 4:28 pm

Can you please add --verb 4 to your OpenVPN configuration file, start the openvpn-server@server unit file ... and provide the output of:

systemctl status openvpn-server@server
journalctl --since today -u openvpn-server@server # (In particular what came after the restart)

update: Also ensure you don't use --syslog, --log or --log-append as well.

Post Reply