How Fast Does Openvpn Generate 2048 Rsa Key
Mar 03, 2017 As I'd forgotten how to create a new OpenVPN user, it's not something I do every day, I thought I put here a reminder of the process used. To get a private key and a signed public key the easiest way is to use the Easy-RSA program that came with openvpn. Change to the directory. For now i am just creating keys manually in command line but now i want it to do in php and get back the result like expiry date of key etc. – Zohaib Ghafoor Apr 23 '16 at 15:29 Can you post an example of the output generated by the command? Generate the CSR code and Private key for your certificate by running this command: openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out servercsr.txt. Note: server.key and servercsr.txt are the Private key and the CSR code files. Feel free to use any file names, as long as you keep the.key and.txt extensions.
- How Fast Does Openvpn Generate 2048 Rsa Keyboard
- How Fast Does Openvpn Generate 2048 Rsa Key Mac
- How Fast Does Openvpn Generate 2048 Rsa Keys
If you want to setup OpenVPN with 4096-bit key on OpenWRT, with a few tips and tricks in addition, read on.
Reasons for setting up VPN
- To access your home network via a secure tunnel from outside.
- To avoid port forwardings which opens up a direct pipe to your home devices, a potential security hole.
- To deny others from eavesdropping on your Internet traffic when using public Wi-Fi.
- To browse the Internet as if you are in your home country when you are abroad. This is useful in circumventing geo-blocking.
OpenVPN is probably the best open source implementation of VPN at this time. It is offered by all public VPN providers that I know of but encryption strength varies.
Setup
Default settings
Prior to using OpenVPN on OpenWRT, I was using OpenVPN on Network-attached Storage. I stopped using after realising that they use 1024-bit key. Then I setup OpenVPN on OpenWRT which as at time of writing this blog post defaults to 2048-bit key. While this is sufficient for today’s needs, an attacker could potentially capture the encrypted data today to be decrypted using much better hardware in future.
Installing OpenVPN on OpenWRT
Install openvpn-easy-rsa
and openvpn-openssl
. If you use OpenWRT GUI, install luci-app-openvpn
as well. Ensure that your router has sufficient free space for these packages! I am unsure how much is required but very sure that routers with 4MB flash memory is insufficient.
Increasing key size from 2048 to 4096 bit
Edit /etc/easy-rsa/vars
using your preferred editor. If you are not sure how to edit, I recommend installing nano
then edit the file by typing nao /etc/easy-rsa/vars
.
Set export KEY_SIZE=4096
.
How Fast Does Openvpn Generate 2048 Rsa Keyboard
Other settings
You should set the following fields so that you do not have to enter them for each key creation.
Password keys
For all steps below, when prompted to enter password for keys, leave them blank.
Clean all
To delete everything in /etc/easy-rsa/keys
folder, run clean-all
. Be warned that this removes all existing keys! Use it only for starting afresh.
Generate Certificate Authority key
Create Certificate Authority (CA) key by running build-ca
. This step produces ca.crt
and ca.key
. The former (certificate) is to be distributed to every client while the latter (key) must not be given out to anyone. If the key is compromised, you must recreate all keys beginning with clean-all
step in previous paragraph.
Generate Diffie Hellman key
Create Diffie Hellman (DH) key by running build-dh
. Note that this takes hours if not days on a typical router! If you want this step to complete significantly faster, install OpenSSL onto your workstation and execute: /nitro-pdf-10-key-generator.html.
Be patient. A modern hardware may still require more than an hour to complete this step. The output is a file dh4096.pem
. Copy this into /etc/easy-rsa/keys
.
Generate server key
This creates a server key called ‘server’.
Generate client keys
For each client, create a key with unique name. Besides this, do not create client keys with the same name as server key.
This generates the following files:
- clientname.crt
- clientname.key
- clientname.p12
Hardening security
While not required, enabling Transport Layer Security (TLS) authentication is strongly recommended. Generate TLS key by running:
This key is a shared secret. Therefore, must be copied to every client. If the server is set to ta.key 0
, the client must be set to ta.key 1
or vice versa.
Copy all keys to openvpn folder
For subsequent configuration steps, point to /etc/openvpn
for keys.
Server configuration
Edit /etc/config/openvpn
. Add and edit where relevant the following:
Restart Openvpn:
Edit /etc/config/network
and add the following. Note that tun-local
must be replaced with whatever you have specified under option dev
in previous step:
Restart network:
Next, setup firewall by editing /etc/config/firewall
. Create a firewall zone for the VPN:
Forward traffic from VPN to WAN:
Forward traffic from VPN to LAN:
Allow incoming connections via UDP port 1194:
Restart firewall: /etc/init.d/firewall restart
Client configuration
Create clientname.ovpn
file:
Copy the OVPN file along with the following files to the client:
- clientname.crt
- clientname.key
- ca.crt
- ta.key
Import the OVPN file using your preferred OpenVPN client. The client should automatically recognise the other four files. If not, explicitly point to them.
Troubleshooting
Read on if you are facing issues. One of the solutions might be helpful to you.
Able to establish connection over mobile network but not from public Wi-Fi
The firewall at the public Wi-Fi network is probably blocking outgoing connections on UDP port 1194. Try using a different port instead of the default 1194. Alternatively, you could support multiple ports by adding an iptable rule per extra port. Below is an example of redirecting incoming UDP port 53 to 1194. UDP 53 is for DNS, very unlikely to be blocked:
If this does not work for you, try using TCP port 443 by changing the following lines in /etc/config/openvpn
:
Unable to connect to remote LAN machines via VPN
Firstly, avoid using very common subnets such as 192.168.0.x
and 192.168.1.x
. If the source (where you are connecting to VPN from) and destination (where the VPN server is running) are on the same subnet, the destination cannot be reached. The server could push a route of that subnet explicitly overriding the client’s route. In doing so however, it prevents connecting to the source LAN when client is connected to VPN. In short, stay away from very common subnets.
How Fast Does Openvpn Generate 2048 Rsa Key Mac
### Unable to ping any machine via VPN
How Fast Does Openvpn Generate 2048 Rsa Keys
I was having no problems connecting to VPN from my Android device but I was not able to connect from a Lubuntu notebook. After trying various settings, the setting that fixed the problem was turning oncomp-lzo
on the Lubuntu notebook. This is despite the server having set the comp-lzo to ‘no’ explicitly and pushing that option to client too.