I've recently installed Ubuntu 20.04 LTS and OpenVPN. The OpenVPN service starts up without errors. But the tun0 interface is missing the IP address and the route.
port 1194
proto udp4
dev tun
ca ./keys/ca.crt
cert ./keys/newbranch.crt
key ./keys/newbranch.key
reneg-sec 36000
dh ./keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ./server/ipp.txt
push "route 192.168.0.0 255.255.255.0"
push "dhcp-option DOMAIN newbranchvpn.lan"
client-to-client
keepalive 30 120
cipher AES-256-CBC
comp-lzo
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log-append /var/log/openvpn/openvpn-server.log
verb 3
explicit-exit-notify 1
tls-server
auth SHA256
tls-version-min 1.2
tls-cipher "TLS-RSA-WITH-AES-256-CBC-SHA256"
script-security 3
learn-address ./scripts/learn-address
client-connect ./scripts/GeoIPRestrict.sh
client-config-dir ./server/staticclients
openvpn-server.log file.
Wed Jun 3 00:00:16 2020 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep>
Wed Jun 3 00:00:16 2020 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Wed Jun 3 00:00:16 2020 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this m>
Wed Jun 3 00:00:16 2020 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Wed Jun 3 00:00:16 2020 Diffie-Hellman initialized with 2048 bit key
Wed Jun 3 00:00:16 2020 ROUTE_GATEWAY 192.168.0.1/255.255.255.0 IFACE=eth0 HWADDR=0a:69:7a:e3:b8:24
Wed Jun 3 00:00:16 2020 TUN/TAP device tun0 opened
Wed Jun 3 00:00:16 2020 TUN/TAP TX queue length set to 100
Wed Jun 3 00:00:16 2020 /sbin/ip link set dev tun0 up mtu 1500
Wed Jun 3 00:00:16 2020 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Wed Jun 3 00:00:16 2020 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Wed Jun 3 00:00:16 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Wed Jun 3 00:00:16 2020 UDPv4 link local (bound): [AF_INET][undef]:1194
Wed Jun 3 00:00:16 2020 UDPv4 link remote: [AF_UNSPEC]
Wed Jun 3 00:00:16 2020 MULTI: multi_init called, r=256 v=256
Wed Jun 3 00:00:16 2020 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='van-dnyqu,10.8.0.4', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='asuslaptop,10.8.0.8', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='dn-v2012,10.8.0.12', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='dn-win2k8,10.8.0.16', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='harry-pc,10.8.0.20', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='harry-pc1,10.8.0.24', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='van-dnyqu,10.8.0.28', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='van-dnyquist,10.8.0.32', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 ifconfig_pool_read(), in='remote-thumb,10.8.0.36', TODO: IPv6
Wed Jun 3 00:00:16 2020 succeeded -> ifconfig_pool_set()
Wed Jun 3 00:00:16 2020 IFCONFIG POOL LIST
Wed Jun 3 00:00:16 2020 van-dnyqu,10.8.0.4
Wed Jun 3 00:00:16 2020 asuslaptop,10.8.0.8
Wed Jun 3 00:00:16 2020 dn-v2012,10.8.0.12
Wed Jun 3 00:00:16 2020 dn-win2k8,10.8.0.16
Wed Jun 3 00:00:16 2020 harry-pc,10.8.0.20
Wed Jun 3 00:00:16 2020 harry-pc1,10.8.0.24
Wed Jun 3 00:00:16 2020 van-dnyqu,10.8.0.28
Wed Jun 3 00:00:16 2020 van-dnyquist,10.8.0.32
Wed Jun 3 00:00:16 2020 remote-thumb,10.8.0.36
Wed Jun 3 00:00:16 2020 Initialization Sequence Completed
ifconfig command result on tun0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet6 fe80::462f:1e65:8955:1527 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 322 bytes 71531 (71.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19 bytes 1056 (1.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Looked in the /var/log/syslog file for any related errors. None were found.
After the service is started I have to run the following commands to get the ip address bound to tun0 and the route added. Once the commands are ran the my clients can now connect to the OpenVPN.
/sbin/ip link set dev tun0 up mtu 1500
/sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
/sbin/ip route add 10.8.0.0/24 via 10.8.0.2
ifconfig result after manually running the commands.
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.255 destination 10.8.0.2
inet6 fe80::462f:1e65:8955:1527 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 322 bytes 71531 (71.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19 bytes 1056 (1.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I've tried the exact configuration in Ubuntu 18.04 LTS and have no issues. Seems to only happen on Ubuntu 20.04. Can anyone recommend on next steps I can check?