Welcome to the Cisco Academy for Vision Impaired Linux Wiki. |
Main /
OpenvpnOnABhostSetting up an Openvpn instance on bhostNote that you should refer to the howto document on http://www.openvpn.net for all the details. Server setup:The machine runs a ubuntu 10.04 minimal install to begin with. Make sure you enable tun/tap in the vps control pannel on bhost and reboot the vps. Now become the super user and install the openvpn package: You'll want to copy the server configuration file from /usr/share/doc/openvpn/examples/sample-config-files to /etc/openvpn and decompress it with If you do this you will have to copy the necessary keys and certificates into /etc/openvpn by hand or specify the correct path to the files. Note that if you run the clean script an rm -rf is done on this folder so don't set it to /etc/openvpn or another folder or it might wipe out content in and below that folder. You might want to up the key size to 2048 if you're paranoid, this will slow down SSL negotiation and the dh parameter generation. By default keys and certificates expire in 10 years. You can change this. Fill in the organization email address country state etc so your certificates contain useful information.
Now let us initialize the system: ./build-ca Various openvpn options match on the common name and you can test for values.
Whilst you're initializing the CA state you might as well generate the DH parameters: Now you want to build your first key which is used to secure the server end of the TLS connection: Build your first client key and certificate. Now it is time to edit the server.conf and fill in the necessary settings.
Now it is time to get the client key, the client certificate and the ca certificate across to your client. Note that keys are meant to be kept secure however crt files can go over insecure channels. Note the security of the intire CA depends on ca.key being kept secret. If you are serious about this use the intermediate script to generate a master CA key, take that key off-line and use an intermediate signing key. In this way if the CA is compromised you can regenerate the signing key from the master key. Copy these files out with winscp or similar don't email them. You might want to rename server.conf to something nice like my-vpn.conf or similar. Now start the daemon: If you see a message that initialisation completed. Move on to client configuration below: Client Configuration:Install the openvpn software on your client. You should have a Client certificate and key along with the CA certificate.
Place these in the correct folder. Copy the client.conf out of the examples folder into the correct place and edit it filling in the filenames and options.
You'll need to set remote to point to your vpn such as: Now if under Windows make sure to turn off the firewall on the tun/tap interface. Launch the openvpn-gui application as administrator and watch the log to see if it connects. If you get the Error "TLS negotiation failed to occur within 60 seconds" check your firewall and the like on the client. Once the vpn is connected try see if you can reach it from the client: If you have comp-lzo enabled on both sides then all traffic over the vpn will be compressed which will result in a potential speed increase as by default encrypted data is incompressible. If you want to redirect the default gateway so all traffic goes over the vpn watch out you don't prevent your machine from reaching the vpn server in the process. Use tracert and similar utilities to check things are reachable. Note that the vpn will show as an empty hop. Note if you redirect the default gateway on the client to your vpn server you'll have to most likely tell the vpn host to nat for the vpn subnet doing something like:
|