Senin, 18 September 2017

Filled Under:

How to change Openvpn port

Hallo reader kallongnet,

This time I am still discussing about how to change port,
In my previous post I have explained about,
how to add & replace dropbear and squid port ..
it feels less afdol if there is still less about adding & replacing the other port ..

Well what I want to discuss now is how to replace openvpn port
there is a question from one of my members ..
can openvpn port in fox / change as we want?
the answer can be as long as the port you want to apply it is not in use by other applications such as in dropbear / squid ..

By default the openVPN port on VPS is installed on port 1194. As time goes by, the need for openVPN has changed. For some reason, many now require OpenVPN to be installed on port 443 or 80.
Just choose which one to use for example want to use port 443 in openvpn.
How to change openVPN port to port 443? Is that hard? Actually replacing the openVPN port is not a difficult thing. But for beginners who learn VPS will be quite confused how to replace openvpn port.

There are also other questions such as openvpn port can be run 2 or more like squid or dropbear that can run 2 or more at once?
the answer CAN NOT.
In Ovpn article in design only serve 1port / single port,
Although there are other ways to do it
outsmart by using IPtables, OpenVPN can also be accessed from other ports so it seems there are many VPN ports on 1 server. But that way I will not discuss in this article how to replace this OpenVPN port ..
Maybe I'll explain it on another occasion yah 🙂

Jump to the point

How to change OpenVPn port


1. First login server using Putty / other ssh terminal.
make sure the port you want to use is not used by other applications.
suppose you want to change the VPN port to 443.check first whether port 443 is being used by other application or not.
To check whether the port is in use or not, enter the command below

netstat-ntlp | grep [nomor-port]


replace [port-number] with the port you want to use
example:

netstat -ntlp | grep 443


If after the command is executed, the text will appear like this example
(something like this)

tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 2150/dropbear
tcp6 0 0 :::443 :::* LISTEN 2150/dropbear


The sign of port 443 is being used by dropbear.
the problem you should do remove / replace port 443 in dropbear,
please read in this article
However, if after the command on the run and, not out any writing, meaning that ports are not in use other applications and ready to use for openVPN port.

2. After the first step is time to edit the openvpn configuration using nano or vim editor, but I think nano is simpler because it's so easy, make sure nano is installed if not please install it with the following command.

For debian os

apt-get -y install nano


For centos os

yum -y install nano


After nano is installed, it's time we edit the OpenVPN config. by Entering the command below

nano /etc/openvpn/server.conf


You will see the openVPN server configuration files. Find port xxxx (eg 1194) search and Replace port 1194 with port you want.




If so, press CTRL + O on the keyboard. then press enter. Then press CTRL + X to exit nano

3. Restart the openVPN server by entering the following command

service openvpn restart


4. Check that the OpenVPN port is already running on the desired port. Check by using the following command:

netstat -ntlp | grep 443


replace the number 443 with the number you input in the previous Openvpn config.

If openVPN is running normally, then it should appear as follows:

root@kallongnet:~# netstat -ntlp | grep 443
tcp        0      0 0.0.0.0:443      0.0.0.0:*    LISTEN
2392/openvpn


Well that was the tutorial how to replace the openvpn port.
very easy is not it? Because in this world nothing is hard if you have the intention to learn it :-P
just so many meetings at this time, hope it helps :)

Send regards for success,
Team Kallongnet

0 komentar:

Posting Komentar