OpenVpn tries to connect to old IP

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
Daimroc
OpenVPN User
Posts: 32
Joined: Tue Feb 25, 2014 8:28 am

OpenVpn tries to connect to old IP

Post by Daimroc » Mon Oct 11, 2021 10:17 am

I have a server in a dynamic IP network. When this IP is changed, I have set my router to handle this. The IP is updated correctly to the domain that OpenVpn is used.

The problem is in the client, that try to connect to the old IP. I am getting this message:

Preserving recently used remote address: [AF_INET]x.x.x.x:Y

Where x.x.x.x is the last IP that OpenVpn could connect.

How could avoid to try to connect to the old IP? I want that OpenVpn connects to the IP that is getting when I try to connect to mydomain.com.

I am using 2.5.4 version of OpenVpn.

Also, the config file is this:

Code: Select all

client
dev tun
dev-node "OpenVPN Wintun"
windows-driver wintun
proto udp
remote mydomain.com 1111
resolv-retry infinite
nobind
persist-key
persist-tun


Thanks.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVpn tries to connect to old IP

Post by TinCanTech » Mon Oct 11, 2021 8:16 pm

You could try --connect-timeout or some of the other options described in the manual.

Post Reply