Server not connecting to test client

Need help configuring your VPN? Just post here and you'll get that help.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
casemang1535
OpenVpn Newbie
Posts: 2
Joined: Wed Sep 28, 2022 3:48 am

Server not connecting to test client

Post by casemang1535 » Wed Sep 28, 2022 9:05 pm

Hello I'm running openvpn road warrior on a 22.04.1 LTS ubuntu vm and I cannot get a client to connect. Ive been looking around for a while and im not sure what exactly is causing the problem. Every time I attempt to get my client to connect I end up timing out.
1.
SERVER CONFIG:
server

kaiba@kaiba-MacBook:~$ sudo more /etc/openvpn/server/server.conf
local 10.0.0.70
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
server-ipv6 fddd:1194:1194:1194::/64
push "redirect-gateway def1 ipv6 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notif


2.
CLIENT CONFIG:
client

client
dev tun
proto udp
remote
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3


3.
SERVER LOG (--verb 4):
Sep 27 19:07:01 kaiba-MacBook systemd-udevd[81386]: Using default interface naming scheme 'v249'.
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: TUN/TAP device tun0 opened
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_iface_mtu_set: mtu 1500 for tun0
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_iface_up: set tun0 up
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_addr_v4_add: 10.8.0.1/24 dev tun0
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_iface_mtu_set: mtu 1500 for tun0
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_iface_up: set tun0 up
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_addr_v6_add: fddd:1194:1194:1194::1/64 dev tun0
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: Could not determine IPv4/IPv6 protocol. Using AF_INET
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: Socket Buffers: R=[212992->212992] S=[212992->212992]
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: TCP/UDP: Socket bind failed on local address [AF_INET]10.0.0.70:1194: Address already in use (errno=98)
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: Exiting due to fatal error
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: Closing TUN/TAP interface
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_addr_v4_del: 10.8.0.1 dev tun0
Sep 27 19:07:01 kaiba-MacBook openvpn[81385]: net_addr_v6_del: fddd:1194:1194:1194::1/64 dev tun0
Sep 27 19:07:01 kaiba-MacBook gnome-shell[1623]: Removing a network device that was not added
Sep 27 19:07:01 kaiba-MacBook systemd[1]: openvpn-server@server.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 19:07:01 kaiba-MacBook systemd[1]: openvpn-server@server.service: Failed with result 'exit-code'.

4.
CLIENT LOG (--verb 4):
⏎[Sep 28, 2022, 15:57:20] Connecting to [) via UDPv4
⏎[Sep 28, 2022, 15:57:30] Server poll timeout, trying next remote entry...
⏎[Sep 28, 2022, 15:57:30] EVENT: RECONNECTING ⏎[Sep 28, 2022, 15:57:30] EVENT: RESOLVE ⏎[Sep 28, 2022, 15:57:30] Contacting
via UDP
⏎[Sep 28, 2022, 15:57:30] EVENT: WAIT ⏎[Sep 28, 2022, 15:57:30] WinCommandAgent: transmitting bypass route to
{
"host" : "",
"ipv6" : false
}

⏎[Sep 28, 2022, 15:57:30] Connecting to ) via UDPv4
⏎[Sep 28, 2022, 15:57:40] Server poll timeout, trying next remote entry...
⏎[Sep 28, 2022, 15:57:40] EVENT: RECONNECTING ⏎[Sep 28, 2022, 15:57:40] EVENT: RESOLVE ⏎[Sep 28, 2022, 15:57:40] Contacting
:via UDP
⏎[Sep 28, 2022, 15:57:40] EVENT: WAIT ⏎[Sep 28, 2022, 15:57:40] WinCommandAgent: transmitting bypass route to
{
"host" : "",
"ipv6" : false
}

⏎[Sep 28, 2022, 15:57:40] Connecting to [) via UDPv4
⏎[Sep 28, 2022, 15:57:50] Server poll timeout, trying next remote entry...
⏎[Sep 28, 2022, 15:57:50] EVENT: RECONNECTING ⏎[Sep 28, 2022, 15:57:50] EVENT: RESOLVE ⏎[Sep 28, 2022, 15:57:50] Contacting
via UDP
⏎[Sep 28, 2022, 15:57:50] EVENT: WAIT ⏎[Sep 28, 2022, 15:57:50] WinCommandAgent: transmitting bypass route to
{
"host" : "",
"ipv6" : false
}

⏎[Sep 28, 2022, 15:57:50] Connecting to [) via UDPv4
⏎[Sep 28, 2022, 15:58:00] EVENT: CONNECTION_TIMEOUT BYTES_OUT : 3240
PACKETS_OUT : 60
CONNECTION_TIMEOUT : 1
N_RECONNECT : 5

User avatar
ordex
OpenVPN Inc.
Posts: 425
Joined: Wed Dec 28, 2016 2:32 am
Location: IRC #openvpn-devel @ libera.chat

Re: Server not connecting to test client

Post by ordex » Thu Sep 29, 2022 11:37 am

It seems there are multiple problems here:
1. the server is not starting at a all. the log says that you already have something listening on that port. Maybe it's another OpenVPN process?
2. the client is unable to connect. Does the server have the proper port forwarding in place?

casemang1535
OpenVpn Newbie
Posts: 2
Joined: Wed Sep 28, 2022 3:48 am

Re: Server not connecting to test client

Post by casemang1535 » Thu Sep 29, 2022 7:09 pm

ordex wrote:
Thu Sep 29, 2022 11:37 am
It seems there are multiple problems here:
1. the server is not starting at a all. the log says that you already have something listening on that port. Maybe it's another OpenVPN process?
2. the client is unable to connect. Does the server have the proper port forwarding in place?
So looking at my iptables it appears that while port forwarding is in place, none of my addresses match my intended public address. Which is strange as I recall setting this up with my public address. On the topic of the ports already being used running the lsof command I can see that a there is in fact a different openvpn process being run under what appears to be a different pid.

Post Reply