Page 1 of 1

Client-side connecting to the wrong IP

Posted: Mon Apr 12, 2021 7:28 pm
by bschaefer
Hello! I've created an EC2 instance with OpenVPN AS on AWS.
Everything was working fine until I've changed the IP to an elastic IP on the EC2 instance.
I've updated the admin console (changed the network IP).
The client.ovpn have the right informations (I will hide some personal informations)

# OVPN_ACCESS_SERVER_PROFILE=**correct user**@**correct IP**
[...]
# OVPN_ACCESS_SERVER_WSHOST=**correct IP**:443

But when the client side tries to connect, it gets this error:
session-start: ** ERROR ** Failed to connect: Connection, Client reconnect

This is the log. It seems that the client side, even with the client.ovpn configured with the new IP, still tries to connect to the old IP from the server.

Apr 12 14:33:06 **local user** net.openvpn.v3.log[5565]: {tag:***} Network Configuration INFO: Socket protect called for socket 8, remote: '**old/wrong IP**', tun: '', ipv6: no
Apr 12 14:33:10 **local user** net.openvpn.v3.log[5565]: {tag:***} Client INFO: Reconnecting
Apr 12 14:33:10 **local user** net.openvpn.v3.log[5565]: {tag:***} Client VERB1: Waiting for server response

I'm able to connect to the server console (Ubuntu based) and to Admin page. My problem is only with the client connection (I've tried on windows and linux)
I didn't changed anything on admin page, besides of "hostname or IP address" on the network settings. Am i missing something?
I'm sorry if this is a basic config, but I've searched everywhere and didn't finding an answer.

Re: Client-side connecting to the wrong IP

Posted: Tue Apr 13, 2021 6:17 am
by openvpn_inc
Hello bschaefer,

I would like to suggest that instead of manually updating the config file (which, if done correctly, should work) and instead make the necessary correction on your Access Server configuration and download/import a new connection profile altogether.

In the Admin UI of the Access Server go to the Network Settings page and in the 'host name or IP address' field put the new address of your Access Server. I would recommend instead of an IP address to use a DNS name here like "vpn.mycompany.com" or whatever domain you have. That way, if you ever change the IP address again, you can simply update the DNS record instead of reprovisioning/reconfiguring your VPN clients to get the new IP address. However if you want you can just keep using an IP address here directly - in that case fill in the public IP address of your Elastic IP.

And then save settings, update running servers, and import a new connection profile on your VPN client, and you should be good.

Kind regards,
Johan

Re: Client-side connecting to the wrong IP

Posted: Mon Apr 19, 2021 3:44 am
by bschaefer
Thank you, Jordan. this worked for me.

For some reason, DNS worked, but IP dont.