<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5564469736286869182</id><updated>2011-09-10T06:47:42.630-07:00</updated><title type='text'>VPN4FREE</title><subtitle type='html'>Your Free Virtual Private Network Solution</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vpn4free.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5564469736286869182/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vpn4free.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>admin</name><uri>http://www.blogger.com/profile/06175185324999892365</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5564469736286869182.post-5001927541359921636</id><published>2010-07-16T23:35:00.000-07:00</published><updated>2010-07-19T00:46:11.881-07:00</updated><title type='text'>Installing OPENVPN on CentOS</title><content type='html'>Last time i tried to install OPENVPN for my vps, so i'm searching in google for the tutorial and i found a few ways to install OPENVPN on CentOS. I tried them all but i got the easiest way to install it, and i will write tutorial here.&lt;br /&gt;&lt;br /&gt;Anyway what is openvpn?&lt;br /&gt;&lt;code&gt;http://en.wikipedia.org/wiki/OpenVPN&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Okay, let's begin.&lt;br /&gt;&lt;br /&gt;First off all install CentOS on your vps, here i'm using SolusVM for OS install and choose CentOS 5.5&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i31.tinypic.com/6pntw1.png"&gt;&lt;img style="width: 467px; height: 120px;" src="http://i31.tinypic.com/6pntw1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'm using CentOS 5.5 because TUN/TAP is not available in CentOS 32bit and x86. Okay, the installation will be finish in approximately 30 minutes, after finished now login to root using ssh.&lt;br /&gt;&lt;br /&gt;Before we're going to install OPENVPN, check your TUN/TAP whether it is active or not, if it's not you can try to install another CentOS or contact your vps provider to activate TUN/TAP.&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#cat /dev/net/tun&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i31.tinypic.com/2n8y89d.png"&gt;&lt;img style="width: 423px; height: 212px;" src="http://i31.tinypic.com/2n8y89d.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;if you're TUN/TAP status is like that, then your TUN/TAP is ready, otherwise it's not.&lt;br /&gt;&lt;br /&gt;Now we're begin the installation, first of all install &lt;span style="font-style: italic;"&gt;gcc&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;make&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install gcc make&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i29.tinypic.com/10nynab.png"&gt;&lt;img style="width: 423px; height: 436px;" src="http://i29.tinypic.com/10nynab.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download package for OPENVPN&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Download repository for OPENVPN&lt;br /&gt;&lt;br /&gt;if you're using 32bit version&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;if you're using 64bit version&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;you can check your server architecture with:&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#uname -a&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Install package needed for OPENVPN&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install rpm-build&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install autoconf.noarch&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install zlib-devel&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install pam-devel&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install openssl-devel&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Install the downloaded rpm package and add the repository to your CentOS&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#rpmbuild --rebuild lzo-1.08-4.rf.src.rpm&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#rpm -Uvh /usr/src/redhat/RPMS/x86_64/lzo-*.rpm&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;note: check your architecture engine, if you're using 32bit then change "x86_64" to "i386"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Install OPENVPN&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#yum install openvpn&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Copy the folder for creating certificate to directory /etc/openvpn/&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#cp -r /usr/share/doc/openvpn-2.0.9/easy-rsa/ /etc/openvpn/&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now let's create the certificate&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#cd /etc/openvpn/easy-rsa/2.0&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#chmod 755 *&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#source ./vars&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#./vars&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#./clean-all&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Build CA&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#./build-ca&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;you'll be asked to fill the field data, you can empty that with click enter repeatedly, but the one you have to fill is the "Common Name" field.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Build Key Server&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#./build-key-server server&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;same as build-ca, but in the "Common Name" fill with: &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;server&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Build Diffie Hellman&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#./build-dh&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Building certificate done, now we create the configuration file in the directory /etc/openvpn&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#cd /etc/openvpn&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#nano server.conf&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;you can also use vi or pico editor to create the configuration file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the example of configuration file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;local 123.123.123.123 #- change it with your server ip address&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;port 1234 #- change the port you want&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;proto udp #- protocol can be tcp or udp&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;dev tun&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;tun-mtu 1500&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;tun-mtu-extra 32&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;mssfix 1450&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;cert /etc/openvpn/easy-rsa/2.0/keys/server.crt&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;key /etc/openvpn/easy-rsa/2.0/keys/server.key&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;client-cert-not-required&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;username-as-common-name&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;server 1.2.4.0 255.255.255.0&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;push "redirect-gateway def1"&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;push "dhcp-option DNS 208.67.222.222"&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;push "dhcp-option DNS 4.2.2.1"&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;keepalive 5 30&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;comp-lzo&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;persist-key&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;persist-tun&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;status server-tcp.log&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;verb 3&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now start the OPENVPN&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#openvpn /etc/openvpn/server.conf&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;if the status is &lt;span style="font-weight: bold;"&gt;Initialization Sequence Completed&lt;/span&gt; then your OPENVPN is ready.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i31.tinypic.com/289j389.png"&gt;&lt;img style="width: 424px; height: 190px;" src="http://i31.tinypic.com/289j389.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now we're enabling ip forward and create NAT iptables rules so we can access the internet with OPENVPN server.&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#echo 1 &gt; /proc/sys/net/ipv4/ip_forward&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you're using VPS:&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#iptables -t nat -A POSTROUTING -s 1.2.3.0/24  -j SNAT --to 123.123.123.123&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you're using Dedicated Server:&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#iptables -t nat -A POSTROUTING -s 1.2.3.0/24 -o eth0 -j MASQUERADE&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Install process is done, now create user for you OPENVPN.&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#useradd username -s /bin/false&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#passwd username&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;to delete existing user, you can use&lt;br /&gt;&lt;code style="color: rgb(255, 0, 0);"&gt;#userdel username&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now go to your OPENVPN GUI config folder and create client configuration file. This is the example for client configuration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;client&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;dev tun&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;proto udp&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;remote 123.123.123.123 4567 #- your OPENVPN server ip and port&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;resolv-retry infinite&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;nobind&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;tun-mtu 1500&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;tun-mtu-extra 32&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;mssfix 1450&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;persist-key&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;persist-tun&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;ca ca.crt&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;auth-user-pass&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;comp-lzo&lt;/code&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;verb 3&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;save the configuration with &lt;span style="font-weight: bold;"&gt;filename.ovpn&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;And the last thing you have to do is download &lt;span style="font-weight: bold;"&gt;ca.crt&lt;/span&gt; file in directory /etc/openvpn/easy-rsa/2.0/keys to your PC and save to the OPENVPN GUI config folder.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://i27.tinypic.com/6r83l0.png"&gt;&lt;img style="width: 424px; height: 262px;" src="http://i27.tinypic.com/6r83l0.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Your OPENVPN is ready!&lt;br /&gt;&lt;br /&gt;if you want to test OPENVPN, here's the config file:&lt;br /&gt;&lt;code&gt;http://rapidshare.com/files/407751537/vpn4free_cfg_test.rar&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;rar pass: &lt;span style="font-weight: bold;"&gt;vpn4free.org&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reference:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;http://blog.hostgokil.com/tutorial-instalasi-openvpn-di-vps-centos.html&lt;br /&gt;http://paijrut.net/?p=7&lt;br /&gt;http://www.kaskus.us/showthread.php?t=4437825&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5564469736286869182-5001927541359921636?l=vpn4free.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vpn4free.blogspot.com/feeds/5001927541359921636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vpn4free.blogspot.com/2010/07/installing-openvpn-on-centos.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5564469736286869182/posts/default/5001927541359921636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5564469736286869182/posts/default/5001927541359921636'/><link rel='alternate' type='text/html' href='http://vpn4free.blogspot.com/2010/07/installing-openvpn-on-centos.html' title='Installing OPENVPN on CentOS'/><author><name>admin</name><uri>http://www.blogger.com/profile/06175185324999892365</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://i31.tinypic.com/6pntw1_th.png' height='72' width='72'/><thr:total>5</thr:total></entry></feed>
