HPCHOST

Client Login Client Login

pfsense - Setting Up An OpenVPN Client On Linux

Setup Linux Clients

1. Download/compile/install the OpenVPN source.

2. The majority of the config files are in /etc/openvpn/clients on Gentoo.

root@localhost:~# cd /etc/openvpn/clients

3. We need to create a new config file, I called mine ren-bgw-01.conf:

root@localhost:/etc/openvpn/clients# vi ren-bgw-01.conf

4. Put the following information in the config file, where n.n.n.n is the IP of your pfSense box:

port 443
dev tun
proto tcp-client
remote n.n.n.n 443
ping 30

persist-tun
persist-key

cipher bf-cbc [this should be the same as what you set in the Cryptography setting in the server GUI.

tls-client
ca /etc/openvpn/clients/keys/ren-bgw-01/ca.crt
cert /etc/openvpn/clients/keys/ren-bgw-01/client2.crt
key /etc/openvpn/clients/keys/ren-bgw-01/client2.key

ns-cert-type server
comp-lzo
pull

5. Now, I put all of my keys in /etc/openvpn/clients/keys/<server>/. Make that directory, and copy ca.crt, client2.crt, and client2.key to there:

root@localhost:/etc/openvpn/clients# mkdir -p keys/<server>
root@localhost:/etc/openvpn/clients# cd /etc/openvpn/clients/keys/<server>
root@localhost:/etc/openvpn/clients/keys/<server>/# cp /etc/openvpn/easy-rsa/keys/ca.crt .
root@localhost:/etc/openvpn/clients/keys/<server>/# cp /etc/openvpn/easy-rsa/keys/client2.crt .
root@localhost:/etc/openvpn/clients/keys/<server>/# cp /etc/openvpn/easy-rsa/keys/client2.key .

6. The last thing is to create the ren-bgw-01 startup script. This must match the config file name (minus the .conf) in order for it to work on Gentoo!. And then we start up the tunnel!

root@localhost:/etc/openvpn/clients/keys/<server>/# cd /etc/init.d/
root@localhost:/etc/init.d/# ln -s openvpn ren-bgw-01
root@localhost:/etc/init.d/# ./ren-bgw-01 start

7. If the tunnel doesn't come up, and/or you want to do testing/debugging, simply start openvpn with the --config option to see what it's doing while it parses your config and attempts to establish the tunnel:

root@localhost:/etc/init.d/# openvpn --config /etc/openvpn/clients/ren-bgw-01.conf 



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
OpenVPN and windows 7 (Views: 474)



Close Chat
HPC Host Live Chat