Connecting to mysql server through virtual private network protocol is very easy to do from the stage of setting up process until the implementation.
I am writing this article, I assume with this condition :
- Mysql server is running up on the local computer network
- Access the Internet using an ADSL modem router
- Client computers that are outside the office want to connect to mysql server that is on your local computer.
Let's get started.
A. Setting up a computer for VPN Server
Vpn network can be executed with a simple home network configuration, like diagaram here :
PC User ----->make vpn connections via internet ----->PPTP VPN Server
1. Click Start -> Control Panel -> Network Connections -> Create a New Connection
2. Then click next - Choose "Set up an Advanced Connection"
3. Then click next - Choose " Accept Incoming Connections"
4. Please Ignore this device for connection entry page, just click Next.
5. Select the option Allow virtual private connections and click Next
6. Select the users who should be allowed to connect to the VPN server.
In this case, I choose a regular user ALV4RO
7. Click Next -> Select "Internet Protocol (TCP / IP)" -> Properties , don't forget check
"Allow callers to access my local area network" If you allow users to access the local area network
includes share files / printers / other devices which shared) If you do not allow, please don't check it.
Select "Assign TCP / IP addresses automatically using DHCP" If you use a DHCP server
(need a special program because XP does not provide a DHCP server by default).
Select the "Specify TCP / IP addresses' range (limits) eg 192.168.0.1 to 192.168.1.255
then automatically connected client will get an IP within that range for available.
Select "Allow calling computer to specify it's own IP address"
If a user is connected may change the configuration of the TCP / IP manually yourself.
Setting up MySQL host
Use sqlyog or others to log in your mysql server, after log in find User Manager – choose root – and the most
important is Host = % ---> ( it means allow MySQL to be access from anywhere )
B. Setting Up PPTP Port Forward on your Modem Router
What is port forwarding? it is a diversion port forwarding (redirection) connections from one IP: Port to IP: Port to another. In other words, all the connections are directed to the IP: port of origin will be transferred to the IP: port destination.
In this tutorial i used TP-LINK Modem + Router.
- Open the admin panel of the modem by accessing http://192.168.1.1
- Select Index Rule 1 (if there is no ports forwarded in the tables)
- please give application name are named according to your choice, because it's just a name only, in this example i gave it name “PPTP”
- Protocol selected "All"
- Start Port and End Port filled in 1723, because I only want to forward port 1723 only
- Local IP Address is filled in accordance with the IP address your laptop or computer. Make sure the IP address your laptop or computer is static, not Dynamic.
- Then click "Save"
C. Setting Up DDNS on your Modem Router
DDNS or Dynamic Domain Name Server is a mechanism for a machine that has a name that is easy to remember. Besides the fact that the main function is to resolve DDNS Public IP Address that is always changing.
DDNS will address a public IP address that is always changing with the host name. So regardless of the IP address to the DDNS we are going to turn it into a hostname. Example hostname: segokucing.no-ip.org
so DDNS service itself in the form of a third party in the form of hostname. There are paid and many are free. One well-known service provider is www.no-ip.com .
- Just simply registering with an email that we have. You will get notifications to your email.
- Choose the hostname that you want.
- Limitations of the free domain name service is provided by the providers is very limited. For example hostname xxxx.no-ip.org, We are only given the freedom to change the xxxx part of its course while the 2 words behind it has been fixed. Example: segokucing.no-ip.org
- Select the tab “Access Management”, then select DDNS
- Dynamic DNS : Activated
- Service Provider : www.no-ip.com
- MY host name : fill with your registration from no-ip.com ( example : iwakpeyek.no-ip.org )
- Username : fill with your username registration when you register from no-ip.com ( example : iwakpeyek )
- Password : fill with your username registration when you register from no-ip.com
- Then click "Save"
D. Configuring PPTP VPN Client on Windows XP
Please note if your PPTP server is behind a router with a DSL / cable internet connection and you are trying to connect to the internet, then you have to connect to your public IP DSL / cable internet connection.
- Go to Start and open Control Panel.
- then double-click the Network Connections icon then Create a New Connection
- Choose Connect to the network at my workplace
- The choose Virtual Private Network Connections option
6. Then give it connections name
7. If you have a dial up connection settings on your computer, this window will appear Public Network.
If your computer is already connected to the public network or a hotspot,
click Do not dial the initial connection option. If you need to call an internet connection
and then initiate a VPN connection, then you need to choose another option,
automatically dial the initial connection.
8. Then give your hostname or IP address from your server
Change default IP 178.63.24.34 to your DDNS name, example : iwakpeyek.no-ip.org
9. Click finish to complete connection wizard
10. Open your windows desktop and double click VPN connection icon, give your username and password
After connected to our vpn server ,you can check connections status icon on Network Connections window
No comments:
Post a Comment