Hey guys,
Recently installed my openvpn server on a Ubuntu 18.04. However, it does not seem to work. After multiple tries, I noticed that whenever I start/restart the openvpn service, tun0 loses is inet address. This is how my tun0 looks after start/restart:
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet6 fe80::af7f:d4af:1de2:b166 prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3 bytes 144 (144.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The client is able to connect to the server, however without any internet access or local access. After running the following command to add inet address to tun0 everything starts working again:
ifconfig tun0 10.8.0.1 netmask 255.255.255.0 up
After further debugging I noticed in the log that openvpn is executing
/sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
However for some reason this does not add the inet to the tun0. It does not say it failed in the log file. If I run the command manually after the openvpn has started it adds the inet to the tun0.
This is my server configuration:
port 1194
proto udp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
push "route 172.26.13.92 255.255.240.0"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 172.26.13.92"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key 0
crl-verify crl.pem
ca ca.crt
cert server_uAPzYAONoPlYYBkH.crt
key server_uAPzYAONoPlYYBkH.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
status /var/log/openvpn/status.log
#log /var/log/openvpn.log
verb 3
Has anyone experienced similar issues with tun0 not getting inet during openvpn server startup?