Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

OpenVPN Server change IP address – Here’s the quick way to do it

by | Feb 14, 2019

OpenVPN helps in securing network data transfer. And, it depends largely on your network properties.

Network changes like switching internet providers often involves changing OpenVPN server IP address too. Unfortunately, wrong steps during IP change can even break the network.

That’s why, we often get queries from our customers in Managed VPN Services regarding modifying OpenVPN setup in the correct way.

Today, we’ll see how our Dedicated Engineers effectively change the OpenVPN server IP address without breaking the network.

 

When do we change OpenVPN server IP address?

Before we proceed further, let’s have a look at the typical scenarios in which there is a need to change OpenVPN server IP.

Recently, one of our customers was changing their backbone internet provider. And, he was left with new pubic IP address. As a result, he had to make a change to his OpenVPN server IP address.

Similarly, some customers prefer to have a specific IP address on their OpenVPN server. This may be due to factors like preferred network range, easy remembrance and so on.

 

How to change OpenVPN server IP address?

In OpenVPN, the change of server IP address is really critical and involves multiple steps. This can be done either from OpenVPN admin panel or from the command line.

Now, let’s take a look on how our Support Engineers change the OpenVPN server IP.

 

1. From command-line

To change the OpenVPN server IP, our Dedicated Engineers modify the OpenVPN server configuration file at /etc/openvpn/server.conf

There will be an entry local  x.x.x.x” that specifies the IP on which the VPN server should listen. So we have to change this entry with the new IP address.

Before adding the new IP, we verify that the IP listens fine on the server. For this, we first check the IP address using:

ip addr | grep inet

Also to check if the port is ready, we check with

netstat -lpan | grep :1194

When there is no such directive, then the server will listen on all IPs of all interfaces.

Further, it requires modification in the client configuration xxx.ovpn file too. This should reflect in the entry

remote 18.xx.yy.105 1194

Here, the IP 18.xx.yy.105 is the new IP address of the server.

Further, to modify the range of IP addresses assigned by the VPN server, we edit the line.

server 10.6.0.0 255.255.255.0

We substitute it with the new IP address and its subnet mask.
Finally, we restart OpenVPN service on the server and that’s it.

In a more simple way, it will be ideal to reconfigure the VPN server and then reissue the client configuration using the openvpn-install.sh too.

openvpn change server ip

 

2. From Web interface

At times, manual modification of the files can be tedious. That’s where the web-based interface helps.

Here, to change the OpenVPN server IP address, our Support Engineers first log in to the Appliance Management web interface. Then, we click on the “Network Tab” and then on “Address”. Further, we add new network properties.

In order for network settings changes to take effect, we reboot the server. When the server is running again, it will have the new OpenVPN server IP address.

 

Common errors with OpenVPN IP address change

Although the steps to change server IP looks pretty straight forward, we often find customers finding problems with it.

Now, let’s take a look at the common OpenVPN problems that our Support Engineers see.

 

1. OpenVPN still listening to old IP address

Recently, one of our customers reported that even after setting the new IP address and restarting, OpenVPN was still showing the old IP address.

Normally, this can happen when there are references to old IP in any of the OpenVPN configuration files. That’s why our Dedicated Engineers first checked and ensured that the new IP address is not overridden later in the configuration file.

Then to fix the problem, we had to execute OpenVPN restart commands in the following order.

/etc/init.d/openvpn restart
/etc/init.d/openvpn restart server

 

2. Problems with DNS

Again, DNS can cause problems with the VPN connection after server IP change. Some VPN providers allow clients to connect to a hostname instead of an IP address. Therefore, even when the OpenVPN server IP changes, there is no need for modification at the client-side.

But, if the OpenVPN server hostname do not resolve to the new IP address, it can create problems.

Here, our Support Engineers begin the investigation by checking the IP address to which the OpenVPN server resolves to. If there are DNS resolution issues, we suggest customers to correct it at their end.

Again, to avoid such DNS resolution problems, we always lower the DNS TTL value for the OpenVPN server hostname before switching the IP address.

[Need help in changing the OpenVPN server IP address? We are here to help you.]

 

Conclusion

In a nutshell, changing the OpenVPN server IP address involves a series of steps. Doing it in the right way can avoid OpenVPN configuration errors. Today, we saw the proper way to change OpenVPN server IP, common problems, and how our Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

2 Comments

  1. Muazam

    Is there anyway we can add time to change automatically after 10 minutes or so?

    Reply
    • Maheen Aboobakkar

      Hello Muazam,

      We’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF