OpenVPN Setup for CentOS 5.5

Cryptographically secure pseudorandom number g...

Today I came across CentOS 5.5 where I had to test a solution encapsulated in PPTP VPN. I tried pptp-setup based VPN but it was old enough for not supporting it. So I had to come up with something else. I use OpenVPN on Ubuntu so I thought of it and started searching.

After around 30 minutes, I came up with this tutorial to install OpenVPN in your CentOS 5.5.


Step 1: Check TUN/TAP status if it’s active or not, using:

cat /dev/net/tun

The response should be:

cat: /dev/net/tun: File descriptor in bad state

Step 2: Install Compilation Tools, using:

yum install gcc make

Step 3: Download OpenVPN Package in /usr/local/src

cd /usr/local/src

and then


Step 4: Check your Processor Architecture using:

uname -a

If result says something including i386 OR i686 OR x86 then you have 32 bit machine.

If result says something including i686_64 or x86_64 then you have 64 but machine.

Step 5: Download OpenVPN Repo, using:

For 32 bit systems:


For 64 bit systems:


Step 7: Install Required YUM Packages using:

yum install rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel

Step 8: Install the Downloaded RPMs and Add them to your repo using given statements one by one. Replace x86_64 with i386 in second & third command in case you’re using 32 bit system:

rpmbuild –rebuild lzo-1.08-4.rf.src.rpm
rpm -Uvh /usr/src/redhat/RPMS/x86_64/lzo-*.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Step 9: Install OpenVPN Yum Package

yum install openvpn

Step 10: Get your OpenVPN Files from Go to OpenVPN Section and download appropriate server’s Zip file.  The link to download was in my case so I did:


Step 11: Unzip file using:


You will now see multiple .ovpn files with different ports. I recommend using udp port. Assuming that I have to use vpnbook-euro1-udp25000.ovpn file available at /home/max/Downloads/ I will follow this command start VPN:

openvpn /home/max/Downloads/vpnbook-euro1-udp25000.ovpn

Step 12: Use Credentials provided from

You will be prompted for usernamd and password. VPNBook username is always vpnbook. The password can be changed and if your ISP doesn’t even allow to open the website, you can simply follow @vpnbook on Twitter where they always announce their current updated password (which is same for all servers).

Once done, OpenVPN will take care of default route itself.


P.S: I can’t do VoIP Calls (SIP Based) on VPNBook, so if you have any other good free or psudo-free service in head, please let me know in comments.

Enhanced by Zemanta

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.