In this tutorial, you’ll learn how to setup a VPN server with Tomato VPN and OpenVPN. We’ll assume that your router is already running Tomato VPN or at least a version of Tomato that has it built-in. We will also assume that you have Dynamic DNS configured on your router to allow inbound requests to your LAN via www.yourdomain.com. You should also have the OpenVPN software installed on your client computer.
In this section, we’re going to setup your router as a Tomato VPN server. We will do so using OpenVPN static key authentication. This method is the most simple to setup and provides fast connectivity. However, you should be aware that the static key is shared between the client and the server. Therefore, this method supports only one VPN client.
If this is your first time setting up a VPN server, you might want to stick around and try your skills using this method first. But if you need to support multiple clients simultaneously, you will eventually need to use the OpenVPN TLS/SSL method instead.
Generate OpenVPN Static Key
First, we’re going to generate a key and create a profile for the client machine. Then, we’ll configure the VPN server settings within the router, copy the key and ‘Start’ the VPN server. Let’s start by generating the key.
- Click ‘Start’ > OpenVPN > Utilities.
- Right-click on ‘Generate a static OpenVPN key’.
- Choose ‘Run as administrator’.
The CMD prompt will open.
Press any key to generate the static key file. The command prompt window will close when the file has been created.
The static key will be saved in the following directory:
C:\Program Files\OpenVPN\config\key.txt.
- Open the key.txt file.
- Click ‘File’ > ‘Save As’
- Rename the file ‘staticvpn.key’ and change save type to ‘All Files’.
- Save the file to C:\Program Files\OpenVPN\config.
Setup the OpenVPN Client Profile
Now, we’ll generate the client configuration profile. This is what the OpenVPN client application will use to initiate the connection to our VPN server. It tells OpenVPN where to connect, what port to use, what protocol to use, the name of the key file, etc.
- Open a text editor such as NotePad. Enter the text as seen in the image above. Replace www.mypublic.net with your domain name or public IP address. If your routers private IP is not 192.168.1.1, change this to whatever your routers IP address is.
- Click ‘File’ > ‘Save As’, then change the file type to ‘All Files’.
- Name the file ‘My Network.ovpn’ and click ‘Save’
- Save the file to C:\Program Files\OpenVPN\config.
Your ‘config’ directory should look like this:
Setup Your Router as a Tomato VPN Server
Navigate to: VPN Tunneling > OpenVPN Server
- Ensure that the ‘Server 1’, and ‘Basic’ tabs are selected.
- Set your settings as seen in the image above.
- Click ‘Save’.
Go to the ‘Advanced’ tab.
Set your settings as seen in the image above. Be sure to include the Custom Configuration text exactly as follows:
push "redirect-gateway def1"
This command tells the Tomato VPN server to push the clients web traffic through the VPN. This way, instead of just accessing devices within your network, you’re now able to browse the Internet through your home network as well. In fact, the VPN server will issue your client device a private IP (192.168.1.x) and your public IP address will appear as if you are browsing the Internet from home –regardless of where you are connecting from!
Click the ‘Keys’ tab.
- Navigate to: C:\Program Files\OpenVPN\config.
- Open the key.txt file. Copy and paste the key into the text area. Click ‘Save’ to save the key.
- Click ‘Start’ to start the OpenVPN server.
Start the OpenVPN client (Run as Admin).
- Navigate to: Start > All Programs > OpenVPN
- Right-click on ‘OpenVPN GUI’ and choose ‘Run as Administrator’.
Connect to your Tomato VPN server
Right-click the OpenVPN icon in your system tray. Choose connect. The status window will open and notify you that the initialization sequence has completed. Upon a successful connection, the icon in the task bar will run green. Now that you are up and running, let’s make sure you understand what is going on behind the scenes.